mirror of
https://github.com/danbulant/discord.js
synced 2026-05-25 13:02:38 +00:00
fix 992 (#994)
This commit is contained in:
parent
736fa7c611
commit
b74c1b70b6
2 changed files with 9 additions and 11 deletions
|
|
@ -249,9 +249,6 @@ class Client extends EventEmitter {
|
|||
for (const i of this._intervals) clearInterval(i);
|
||||
this._timeouts.clear();
|
||||
this._intervals.clear();
|
||||
this.token = null;
|
||||
this.email = null;
|
||||
this.password = null;
|
||||
return this.manager.destroy();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,14 +59,15 @@ class ClientManager {
|
|||
}
|
||||
|
||||
destroy() {
|
||||
return new Promise(resolve => {
|
||||
this.client.ws.destroy();
|
||||
if (!this.client.user.bot) {
|
||||
resolve(this.client.rest.methods.logout());
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
this.client.ws.destroy();
|
||||
if (this.client.user.bot) {
|
||||
this.client.token = null;
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return this.client.rest.methods.logout().then(() => {
|
||||
this.client.token = null;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue