finalised revive

This commit is contained in:
Amish Shah
2015-12-06 20:19:30 +00:00
parent d504406cfc
commit b59f2940e3
5 changed files with 13 additions and 8 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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;