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

79
Vistas
Discord Bot isn't responding

For some reason, the basic ping pong command isn't working. I copied and pasted it from a website, but I am not sure what is wrong with it.

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



client.once('ready', () => {
    console.log('Ready!');
});

client.on('interactionCreate', interaction => {
    if (!interaction.isCommand()) return;

    const { commandName } = interaction;

    if (commandName === 'ping') {
        interaction.reply('Pong.');
    }

});

There is no log error which makes it weirder. I know it is connecting because the bot appears online when I do a node index.js in the cmd panel.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Firstly, I recommend that you fix the indentation at the beginning and move the client.login call to the end, as that's how the discord.js docs do it.

Additionally, are you sure you're using Discord.js v13? These events were added in v13, so if you run it with Discord.js v12, your bot will run, but your functions will never be called.

Otherwise, your code looks good (to me), but I'm not an expert.

about 4 years ago · Juan Pablo Isaza Denunciar
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