mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 17:43:30 +01:00
Revert "fix Client.destroy bugs" (#839)
This commit is contained in:
@@ -58,11 +58,14 @@ class ClientManager {
|
||||
}
|
||||
|
||||
destroy() {
|
||||
let p = Promise.resolve();
|
||||
if (!this.client.user.bot) {
|
||||
p = this.client.rest.methods.logout();
|
||||
}
|
||||
return p.then(() => this.client.ws.destroy());
|
||||
return new Promise((resolve) => {
|
||||
if (!this.client.user.bot) {
|
||||
this.client.rest.methods.logout().then(resolve);
|
||||
} else {
|
||||
this.client.ws.destroy();
|
||||
resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user