mirror of
https://github.com/danbulant/discord.js
synced 2026-06-24 17:21:59 +00:00
fix Client#login from other invalid things (#2013)
This commit is contained in:
parent
97823bc376
commit
69dcfa0708
1 changed files with 1 additions and 1 deletions
|
|
@ -259,7 +259,7 @@ class Client extends BaseClient {
|
||||||
*/
|
*/
|
||||||
login(token) {
|
login(token) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (typeof token !== 'string') throw new Error('TOKEN_INVALID');
|
if (!token || typeof token !== 'string') throw new Error('TOKEN_INVALID');
|
||||||
token = token.replace(/^Bot\s*/i, '');
|
token = token.replace(/^Bot\s*/i, '');
|
||||||
this.manager.connectToWebSocket(token, resolve, reject);
|
this.manager.connectToWebSocket(token, resolve, reject);
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue