mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 11:33:30 +01:00
Token Cache bug fix and Rate Limiting
This commit is contained in:
@@ -43,7 +43,11 @@ var TokenCacher = (function (_EventEmitter) {
|
||||
this.data = {};
|
||||
}
|
||||
|
||||
TokenCacher.prototype.setToken = function setToken(email, password, token) {
|
||||
TokenCacher.prototype.setToken = function setToken() {
|
||||
var email = arguments.length <= 0 || arguments[0] === undefined ? "" : arguments[0];
|
||||
var password = arguments.length <= 1 || arguments[1] === undefined ? "" : arguments[1];
|
||||
var token = arguments.length <= 2 || arguments[2] === undefined ? "" : arguments[2];
|
||||
|
||||
email = secureEmail(email, password);
|
||||
var cipher = _crypto2["default"].createCipher(algo, password);
|
||||
var crypted = cipher.update("valid" + token, "utf8", "hex");
|
||||
@@ -56,7 +60,9 @@ var TokenCacher = (function (_EventEmitter) {
|
||||
_fsExtra2["default"].writeJson(this.savePath, this.data);
|
||||
};
|
||||
|
||||
TokenCacher.prototype.getToken = function getToken(email, password) {
|
||||
TokenCacher.prototype.getToken = function getToken() {
|
||||
var email = arguments.length <= 0 || arguments[0] === undefined ? "" : arguments[0];
|
||||
var password = arguments.length <= 1 || arguments[1] === undefined ? "" : arguments[1];
|
||||
|
||||
email = secureEmail(email, password);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user