mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 10:03:31 +01:00
Clean up some stuff
This commit is contained in:
@@ -13,9 +13,15 @@ class RESTMethods {
|
||||
this.rest = restManager;
|
||||
}
|
||||
|
||||
loginToken(token) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.rest.client.manager.connectToWebSocket(token, resolve, reject);
|
||||
});
|
||||
}
|
||||
|
||||
loginEmailPassword(email, password) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.rest.client.emit('debug', 'Client launched using email and password - should use token instead');
|
||||
this.rest.client.emit('warn', 'Client launched using email and password - should use token instead');
|
||||
this.rest.client.email = email;
|
||||
this.rest.client.password = password;
|
||||
this.rest.makeRequest('post', Constants.Endpoints.login, false, { email, password })
|
||||
@@ -26,12 +32,6 @@ class RESTMethods {
|
||||
});
|
||||
}
|
||||
|
||||
loginToken(token) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this.rest.client.manager.connectToWebSocket(token, resolve, reject);
|
||||
});
|
||||
}
|
||||
|
||||
logout() {
|
||||
return this.rest.makeRequest('post', Constants.Endpoints.logout, true);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const RequestHandler = require('./RequestHandler');
|
||||
|
||||
class BurstRequestHandler extends RequestHandler {
|
||||
|
||||
constructor(restManager, endpoint) {
|
||||
super(restManager, endpoint);
|
||||
this.requestRemaining = 1;
|
||||
@@ -58,7 +57,6 @@ class BurstRequestHandler extends RequestHandler {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
handle() {
|
||||
super.handle();
|
||||
if (this.requestRemaining < 1 || this.queue.length === 0 || this.globalLimit) return;
|
||||
@@ -67,7 +65,6 @@ class BurstRequestHandler extends RequestHandler {
|
||||
this.requestRemaining--;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = BurstRequestHandler;
|
||||
|
||||
Reference in New Issue
Block a user