mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +01:00
Stuff
This commit is contained in:
@@ -74,6 +74,10 @@ var _VoiceVoiceConnection = require("../Voice/VoiceConnection");
|
||||
|
||||
var _VoiceVoiceConnection2 = _interopRequireDefault(_VoiceVoiceConnection);
|
||||
|
||||
var _UtilTokenCacher = require("../Util/TokenCacher");
|
||||
|
||||
var _UtilTokenCacher2 = _interopRequireDefault(_UtilTokenCacher);
|
||||
|
||||
var zlib;
|
||||
var libVersion = require('../../package.json').version;
|
||||
|
||||
@@ -162,6 +166,9 @@ var InternalClient = (function () {
|
||||
this.resolver = new _ResolverResolver2["default"](this);
|
||||
this.readyTime = null;
|
||||
this.messageAwaits = {};
|
||||
|
||||
this.tokenCacher = new _UtilTokenCacher2["default"](this.client);
|
||||
this.tokenCacher.init(0);
|
||||
};
|
||||
|
||||
InternalClient.prototype.cleanIntervals = function cleanIntervals() {
|
||||
@@ -357,6 +364,18 @@ var InternalClient = (function () {
|
||||
var _this6 = this;
|
||||
|
||||
var client = this.client;
|
||||
|
||||
console.log(this.tokenCacher.done);
|
||||
if (!this.tokenCacher.done) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
setTimeout(function () {
|
||||
_this6.login(email, password).then(resolve)["catch"](reject);
|
||||
}, 20);
|
||||
});
|
||||
} else {
|
||||
console.log("YAA - " + this.tokenCacher.getToken(email, password));
|
||||
}
|
||||
|
||||
if (this.state !== _ConnectionState2["default"].DISCONNECTED && this.state !== _ConnectionState2["default"].IDLE) {
|
||||
return Promise.reject(new Error("already logging in/logged in/ready!"));
|
||||
}
|
||||
@@ -368,6 +387,7 @@ var InternalClient = (function () {
|
||||
password: password
|
||||
}).then(function (res) {
|
||||
var token = res.token;
|
||||
_this6.tokenCacher.setToken(email, password, token);
|
||||
_this6.state = _ConnectionState2["default"].LOGGED_IN;
|
||||
_this6.token = token;
|
||||
_this6.email = email;
|
||||
|
||||
Reference in New Issue
Block a user