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

244
Vistas
How do I count the amount of reactions made on a specific emoji from a message that was sent? | discord.js v13

I'm trying to make a bot where a user makes a poll and if a certain emoji that the bot has reacted with reaches a number, say 10, then it does other actions. However, that is not my issue. My issue is collecting the amount of reactions itself from that emoji.

My Code:

    const embedSend = await message.channel.send({ embeds: [suggestionEmbed] }).then(async sEmbed => {
        await sEmbed.react('⬆️');
        await sEmbed.react('⬇️');
        const filter = (reaction, user) => {
            return ['⬆️', '⬇️'].includes(reaction.emoji.name) && user.id === message.author.id;
        };
        sEmbed.awaitReactions({ filter, max: 20, time: 50000, errors: ['time'] })
        .then(collected => {
            const reaction = collected.first();
            if (reaction.emoji.name === '⬆️') {
                console.log('up');
            } else if (reaction.emoji.name === '⬇️') {
                console.log('down');

            }
        })
        .catch(collected => {
           console.log("didnt reach 20 reacts");
        });
    });

I tried using the previous method above. However, it doesn't seem to actually print up or down for every reaction after reaching 20 reacts but instead it prints nothing or just up or just down. I've tried using the line of code below to count the emojis but no luck either:

  console.log(sEmbed.reactions.find(reaction => reaction.emoji.name === '⬆️').count)

Placed this inside of the .then statement with the awaitReactions right under the If-else block of code and got no output.

 embedSend.reactions.cache.get('⬆️').count;

This I've placed after the embedSend and it returns me this error:

TypeError: Cannot read property 'reactions' of undefined

and if i place it within the block of code tiehr the embedSend or awaitReactions and change it to sEmbed it returns nothing.

about 4 years ago · Juan Pablo Isaza
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