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

111
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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