diff --git a/lib/Client.js b/lib/Client.js index e8d567880..56792db71 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -424,6 +424,9 @@ class Client extends EventEmitter { * @returns {Promise} Resolves when all shards are initialized */ async connect() { + if(typeof this._token !== "string") { + throw new Error(`Invalid token "${this._token}"`); + } try { const data = await (this.options.maxShards === "auto" || (this.options.shardConcurrency === "auto" && this.bot) ? this.getBotGateway() : this.getGateway()); if(!data.url || (this.options.maxShards === "auto" && !data.shards)) {