Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

227
Visualizações
Discord Bot not going online
require("dotenv").config();
const { Client, Intents } = require("discord.js");

const client = new Client({
  intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES],
});

client.on("ready", () => {
  console.log("bot is ready");
});

client.login(process.env.DISCORD_BOT_TOKEN).catch((e) => {
  console.log(e);
});

OUTPUT

HTTPError [ReferenceError]: AbortController is not defined
    at RequestHandler.execute (g:\goofy-translator\node_modules\discord.js\src\rest\RequestHandler.js:172:15)
    at RequestHandler.execute (g:\goofy-translator\node_modules\discord.js\src\rest\RequestHandler.js:176:19)
    at RequestHandler.push (g:\goofy-translator\node_modules\discord.js\src\rest\RequestHandler.js:50:25)
    at async WebSocketManager.connect (g:\goofy-translator\node_modules\discord.js\src\client\websocket\WebSocketManager.js:128:9)
    at async Client.login (g:\goofy-translator\node_modules\discord.js\src\client\Client.js:245:7) {
  code: 500,
  method: 'get',
  path: '/gateway/bot',
  requestData: { json: undefined, files: [] }
}

The error is caused by client.login() method.Already triple checked the bot token and all seems fine. The problem isn't in the enviroment varible either, because also doesn't work when I pass the token directly.

[Resolved] The problem was the node version, discord.js requires v16 min

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Since version 13 of Discord.js, the library requires that you use a more recent Node.js version. According to the docs, you need to use Node.js version v16.6.0 or higher.

For more information about how to change your node version, or use multiple node versions, see NVM for Windows or NVM for Linux depending on your OS.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda