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

82
Visualizações
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 Respostas
Responde à pergunta

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 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