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

275
Vistas
I can't get my bot to recognize the reaction and respond to it (Discord.js)
const Discord = require ('discord.js')

module.exports.run = async (client, message, reaction, user) => {
        
        message.channel.send("Press **F** to pay respect!!").then(msg => {msg.react("<:pressf:861646469180948530>")})
        
        const filter = (reaction, user) => {
                return reaction.emoji.name === ' === "<:pressf:861646469180948530>' && user.id === message.author.id;
                
        };
        
        
        const collector = message.createReactionCollector( filter);
        
        
        collector.on('collect', (reaction, user) => {
                if (message.emoji.name === "<:pressf:861646469180948530>"){
                        message.channel.send("You pay respect!!")
                }
        })
        
};
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The problem is you're setting up the reaction collector on the original message. Try to wait for the sent one, and accept reactions on that:

module.exports.run = async (client, message, reaction, user) => {
  const sentMessage = await message.channel.send('Press **F** to pay respect!!');

  sentMessage.react('<:pressf:861646469180948530>');

  const filter = (reaction, user) =>
    // there was an extra  === " here
    reaction.emoji.name === '<:pressf:861646469180948530>' &&
    user.id === message.author.id;

  const collector = sentMessage.createReactionCollector(filter);

  collector.on('collect', (reaction, user) => {
    if (reaction.emoji.name === '<:pressf:861646469180948530>') {
      message.channel.send('You pay respect!!');
    }
  });
};
over 4 years ago · Santiago Trujillo 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