mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
finalised revive
This commit is contained in:
@@ -41,7 +41,7 @@ var Client = (function (_EventEmitter) {
|
||||
_EventEmitter.call(this);
|
||||
this.options = options || {};
|
||||
this.options.compress = options.compress || true;
|
||||
this.options.autoRevive = options.autoRevive || false;
|
||||
this.options.revive = options.revive || false;
|
||||
this.internal = new _InternalClient2["default"](this);
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,7 @@ var InternalClient = (function () {
|
||||
|
||||
this.leaveVoiceChannel();
|
||||
|
||||
if (this.client.options.autoRevive && !forced) {
|
||||
if (this.client.options.revive && !forced) {
|
||||
this.setup();
|
||||
this.login(this.email, this.password);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ export default class Client extends EventEmitter {
|
||||
super();
|
||||
this.options = options || {};
|
||||
this.options.compress = options.compress || true;
|
||||
this.options.autoRevive = options.autoRevive || false;
|
||||
this.options.revive = options.revive || false;
|
||||
this.internal = new InternalClient(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ export default class InternalClient {
|
||||
|
||||
this.leaveVoiceChannel();
|
||||
|
||||
if(this.client.options.autoRevive && !forced){
|
||||
if(this.client.options.revive && !forced){
|
||||
this.setup();
|
||||
this.login(this.email, this.password);
|
||||
}
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
/* global process */
|
||||
|
||||
var Discord = require("../");
|
||||
var client = new Discord.Client({autoRevive : true});
|
||||
var client = new Discord.Client({revive : true});
|
||||
var request = require("superagent");
|
||||
|
||||
client.on("ready", () => {
|
||||
console.log("ready");
|
||||
|
||||
setTimeout(() => {
|
||||
client.internal.websocket.close();
|
||||
}, 10000);
|
||||
if(client.internal.websocket)
|
||||
client.internal.websocket.close();
|
||||
}, 5000);
|
||||
|
||||
});
|
||||
|
||||
@@ -50,4 +51,8 @@ console.log("INIT");
|
||||
|
||||
client.on("debug", console.log)
|
||||
|
||||
client.login(process.env["ds_email"], process.env["ds_password"]).catch(console.log);
|
||||
client.login(process.env["ds_email"], process.env["ds_password"]).catch(console.log);
|
||||
|
||||
|
||||
var chan1, chan2;
|
||||
var msg1, msg2;
|
||||
Reference in New Issue
Block a user