mirror of
https://github.com/danbulant/discord.js
synced 2026-06-07 16:52:16 +00:00
Fix some destroy stuff (#828)
This commit is contained in:
parent
a2f125e416
commit
5e2ee2398e
2 changed files with 9 additions and 11 deletions
|
|
@ -235,16 +235,14 @@ class Client extends EventEmitter {
|
||||||
*/
|
*/
|
||||||
destroy() {
|
destroy() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.manager.destroy().then(() => {
|
for (const t of this._timeouts) clearTimeout(t);
|
||||||
for (const t of this._timeouts) clearTimeout(t);
|
for (const i of this._intervals) clearInterval(i);
|
||||||
for (const i of this._intervals) clearInterval(i);
|
this._timeouts = [];
|
||||||
this._timeouts = [];
|
this._intervals = [];
|
||||||
this._intervals = [];
|
this.token = null;
|
||||||
this.token = null;
|
this.email = null;
|
||||||
this.email = null;
|
this.password = null;
|
||||||
this.password = null;
|
this.manager.destroy().then(resolve).catch(reject);
|
||||||
resolve();
|
|
||||||
}).catch(reject);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class RESTMethods {
|
||||||
}
|
}
|
||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
return this.rest.makeRequest('post', Constants.Endpoints.logout, true);
|
return this.rest.makeRequest('post', Constants.Endpoints.logout, true, {});
|
||||||
}
|
}
|
||||||
|
|
||||||
getGateway() {
|
getGateway() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue