mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
fix Client#login from other invalid things (#2013)
This commit is contained in:
@@ -259,7 +259,7 @@ class Client extends BaseClient {
|
||||
*/
|
||||
login(token) {
|
||||
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, '');
|
||||
this.manager.connectToWebSocket(token, resolve, reject);
|
||||
}).catch(e => {
|
||||
|
||||
Reference in New Issue
Block a user