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

123
Vistas
My reaction on discord message return nothing

I try to make a bot that sends a message every morning at 9 o'clock with a possible reaction which for the moment writes me something in the console, the message on discord is sent well but the fact of clicking on l emoji does nothing, can you help me solve my problem? Here is the code:

var rule = new schedule.RecurrenceRule();
    rule.hour = 9;
    rule.minute = 0;
    rule.tz = 'Europe/Paris';
    schedule.scheduleJob(rule, async function() {
        var question = await getQuestion();
        message = await client.channels.cache.get(process.env.CHANNEL_ID).send(`**hello @everyone The wake up question.** \n${question}`)
        message.react('👍')
        const filter = (reaction, user) => {
            return (['👍'].includes(reaction.emoji.name) && user.id === message.author.id);
        };
        message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
            .then(collected => {
                const reaction = collected.first();
                if (reaction.emoji.name === '👍') {
                    console.log("message")
                }
            })
    });
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Maybe you can try to use message.createReactionCollection() instead of message.awaitReactions().

Here is a code that works for me :

msg.react('❌');

const filter1 = (reaction, user) => reaction.emoji.name === '❌' && user.id === message.author.id;

const collector1 = msg.createReactionCollector(filter1, {time: 60000});
  collector1.on('collect', () => {
  msg.delete();
})

//This is a code that works for me, but in your code you don't want to filter reactions with user.id === message.author.id, as the one who will react isn't the one who sent the message

But be careful, as your message is sent automatically every day, don't check if the message author is the one who reacted : remove user.id === message.author.id

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