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

232
Vistas
Discordbot with Javascript not reacting

im currently learning to code discordbots with node.js. For some reason the bot goes online but dont react to the commands ive coded. To test reasons ive even took the solution from a tutorial but still the same problem. Does anybody know a solution?

const client = new Discord.Client();
const prefix = '-';
client.once('ready', () => {
    console.log('BOT ist online');
});

client.on('Message', (message) => {
    if(!message.content.startsWith(prefix) || message.author.bot) return;

    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();

    if(command === 'ping'){
        message.channel.send('pong!');}
    else if(command == 'youtube'){
        message.channel.send('TEST');}
    });
client.login('Here goes the token');
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

This is a small fix so I would just comment if I could but I’m not able to yet.

Where you’re doing:

client.on('Message', …)

It should be a lowercase "m" on message like this:

client.on('message', msg => {
  if (msg.content === 'ping') {
     msg.reply('Pong!');
  }
});
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