diff --git a/src/client/Client.js b/src/client/Client.js index 22163e77a..39a222154 100644 --- a/src/client/Client.js +++ b/src/client/Client.js @@ -234,16 +234,14 @@ class Client extends EventEmitter { * @returns {Promise} */ destroy() { - return new Promise((resolve, reject) => { - for (const t of this._timeouts) clearTimeout(t); - for (const i of this._intervals) clearInterval(i); - this._timeouts = []; - this._intervals = []; - this.token = null; - this.email = null; - this.password = null; - this.manager.destroy().then(resolve).catch(reject); - }); + for (const t of this._timeouts) clearTimeout(t); + for (const i of this._intervals) clearInterval(i); + this._timeouts = []; + this._intervals = []; + this.token = null; + this.email = null; + this.password = null; + return this.manager.destroy(); } /** diff --git a/src/client/ClientManager.js b/src/client/ClientManager.js index 89acc523a..03d43b375 100644 --- a/src/client/ClientManager.js +++ b/src/client/ClientManager.js @@ -59,10 +59,10 @@ class ClientManager { destroy() { return new Promise((resolve) => { + this.client.ws.destroy(); if (!this.client.user.bot) { this.client.rest.methods.logout().then(resolve); } else { - this.client.ws.destroy(); resolve(); } });