diff --git a/lib/Client/Client.js b/lib/Client/Client.js index 81c15f9f7..a473a52c5 100644 --- a/lib/Client/Client.js +++ b/lib/Client/Client.js @@ -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); } diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index ca9db7d21..366355f4b 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -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); } diff --git a/src/Client/Client.js b/src/Client/Client.js index 41aebb68e..ba09bb83c 100644 --- a/src/Client/Client.js +++ b/src/Client/Client.js @@ -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); } diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index 17e3f6c20..4be9b1323 100644 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -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); } diff --git a/test/msgbot.js b/test/msgbot.js index 7ddcafd41..e093e0fae 100644 --- a/test/msgbot.js +++ b/test/msgbot.js @@ -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); \ No newline at end of file +client.login(process.env["ds_email"], process.env["ds_password"]).catch(console.log); + + +var chan1, chan2; +var msg1, msg2; \ No newline at end of file