Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

242
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!