mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
fix 992 (#994)
This commit is contained in:
committed by
Schuyler Cebulskie
parent
736fa7c611
commit
b74c1b70b6
@@ -249,9 +249,6 @@ class Client extends EventEmitter {
|
|||||||
for (const i of this._intervals) clearInterval(i);
|
for (const i of this._intervals) clearInterval(i);
|
||||||
this._timeouts.clear();
|
this._timeouts.clear();
|
||||||
this._intervals.clear();
|
this._intervals.clear();
|
||||||
this.token = null;
|
|
||||||
this.email = null;
|
|
||||||
this.password = null;
|
|
||||||
return this.manager.destroy();
|
return this.manager.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,14 +59,15 @@ class ClientManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy() {
|
||||||
return new Promise(resolve => {
|
this.client.ws.destroy();
|
||||||
this.client.ws.destroy();
|
if (this.client.user.bot) {
|
||||||
if (!this.client.user.bot) {
|
this.client.token = null;
|
||||||
resolve(this.client.rest.methods.logout());
|
return Promise.resolve();
|
||||||
} else {
|
} else {
|
||||||
resolve();
|
return this.client.rest.methods.logout().then(() => {
|
||||||
}
|
this.client.token = null;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user