mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
fix: bots being unable to connect
This commit is contained in:
@@ -27,9 +27,7 @@ class RESTManager {
|
|||||||
|
|
||||||
getAuth() {
|
getAuth() {
|
||||||
const token = this.client.token || this.client.accessToken;
|
const token = this.client.token || this.client.accessToken;
|
||||||
const prefixed = !!this.client.application || this.client.user;
|
if (token) return `${this.tokenPrefix} ${token}`;
|
||||||
if (token && prefixed) return `${this.tokenPrefix} ${token}`;
|
|
||||||
else if (token) return token;
|
|
||||||
throw new Error('TOKEN_MISSING');
|
throw new Error('TOKEN_MISSING');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user