Last' Ysyyn
DIAdiscord.js - Imagine an app
•Created by Last' Ysyyn on 3/8/2024 in #djs-questions
Error validating bot token: InvalidArgumentError: invalid Authorization header
Hello sir i'm facing suddenly new djs error in v14 when i try to login into the bot and i'm sure 100% all intents enabled and token working
my code
error
Help here pls
botToken = await getToken(1);
console.log(botToken);
// Validate the bot token
clientForValidation = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
});
await clientForValidation.login(botToken);
clientForValidation.once(Events.ClientReady, readyClient => {
console.log(`Ready! Logged in as ${readyClient.user.tag}`);
});
botToken = await getToken(1);
console.log(botToken);
// Validate the bot token
clientForValidation = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
});
await clientForValidation.login(botToken);
clientForValidation.once(Events.ClientReady, readyClient => {
console.log(`Ready! Logged in as ${readyClient.user.tag}`);
});
js
Error validating bot token: InvalidArgumentError: invalid Authorization header
at processHeaderValue (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:394:11)
at processHeader (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:478:31)
at new Request (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:192:9)
at [http1 build request] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:338:12)
at [dispatch] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/client.js:363:36)
at Intercept (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/interceptor/redirectInterceptor.js:11:16)
at [Intercepted Dispatch] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher-base.js:158:12)
at Client.dispatch (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher-base.js:179:40)
at [dispatch] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/pool-base.js:143:28)
at [Intercepted Dispatch] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher-base.js:150:29) {
code: 'UND_ERR_INVALID_ARG'
}
js
Error validating bot token: InvalidArgumentError: invalid Authorization header
at processHeaderValue (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:394:11)
at processHeader (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:478:31)
at new Request (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:192:9)
at [http1 build request] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/core/request.js:338:12)
at [dispatch] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/client.js:363:36)
at Intercept (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/interceptor/redirectInterceptor.js:11:16)
at [Intercepted Dispatch] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher-base.js:158:12)
at Client.dispatch (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher-base.js:179:40)
at [dispatch] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/pool-base.js:143:28)
at [Intercepted Dispatch] (/root/rush/node_modules/@discordjs/rest/node_modules/undici/lib/dispatcher-base.js:150:29) {
code: 'UND_ERR_INVALID_ARG'
}
46 replies