Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

313
Vistas
I'm trying to create a discord bot but I am unable to run it with 'node index.js'. How do I fix this?

This is the code I created to run the bot (I'm still very new to coding so I apologize, and the token was regenerated so don't worry):

const Discord = require('discord.js');
const { Client, Intents } = require ('discord.js');
const client = new Discord.Client({ intents: [Intents.FLAGS.GUILDS] })

client.on('ready', () => {
  console.log(`We are now online!`);
});

client.on('message', msg => {
  if (msg.content === '!help') {
    msg.reply('Help yourself.');
  }
});

client.login('j1mz8eMBhKcgY4yZEzbXG4sxuniVB0AY');

This is the warning I received when I used 'node index.js':

(node:64810) UnhandledPromiseRejectionWarning: ReferenceError: AbortController is not defined
    at RequestHandler.execute (/Users/Name/Desktop/Bots/node_modules/discord.js/src/rest/RequestHandler.js:172:15)
    at RequestHandler.execute (/Users/Name/Desktop/Bots/node_modules/discord.js/src/rest/RequestHandler.js:176:19)
    at RequestHandler.push (/Users/Name/Desktop/Bots/node_modules/discord.js/src/rest/RequestHandler.js:50:25)
    at async WebSocketManager.connect (/Users/Name/Desktop/Bots/node_modules/discord.js/src/client/websocket/WebSocketManager.js:128:9)
    at async Client.login (/Users/Name/Desktop/Bots/node_modules/discord.js/src/client/Client.js:245:7)
(Use `node --trace-warnings ...` to show where the warning was created)

I'm not sure what to do to fix this.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda