mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 22:11:53 +00:00
fix(Client): login catch
This commit is contained in:
parent
3d82ca901b
commit
a667e44c4d
1 changed files with 4 additions and 5 deletions
|
|
@ -31,11 +31,10 @@ class RESTMethods {
|
|||
return new Promise((resolve, reject) => {
|
||||
if (!token || typeof token !== 'string') throw new Error(Constants.Errors.INVALID_TOKEN);
|
||||
token = token.replace(/^Bot\s*/i, '');
|
||||
this.client.manager.connectToWebSocket(token, resolve, reject)
|
||||
.catch(e => {
|
||||
this.client.destroy();
|
||||
return Promise.reject(e);
|
||||
});
|
||||
this.client.manager.connectToWebSocket(token, resolve, reject);
|
||||
}).catch(e => {
|
||||
this.client.destroy();
|
||||
return Promise.reject(e);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue