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

113
Visualizações
Ping test for a javascript discord bot

enter image description here

I have use this javascript program for my discord bot but when I use the command "!ping" in discord, the bot don't reply

Even if it is online, it does not work

I don't know what I can do for change this

Can I have help ?

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

0

The message event has been changed to messageCreate, try changing it to that, also you should use message.member instead of message.author.member. If that doesn't fix anything then the issue is most likely with the startup.

E.g.

client.on('messageCreate', async message => {
    if (message.content === "!ping") {
        message.channel.send(`Pong`);
    }
}
about 4 years ago · Juan Pablo Isaza Relatório

0

In my own bot, i use this code

// A chaque message sur le Discord.
client.on('message', async message => {
    //Définition des variables
    let member = message.author.member;
    if (message.content.startsWith("!ping")) {
        // On envoi un MP avec le Bot
        message.channel.send(`Pong`);
        message.delete();
    }
}

This code is actually ok and use in 3 bots on 5 discords for me. The difference between my code and your, is the

client.on('message', async message =>
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