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

362
Views
How to count amount of reactions in Discord.js v13?

I have tried so many things out, here's my current code

        var green = toString(msg.reactions.cache.get('๐ŸŸฉ').count);
        var red = toString(msg.reactions.cache.get('๐ŸŸฅ').count);
          
         msg.reply("Poll has ended which was created by " + msg.author.username)
         msg.reply(green + " " + red)

It gives this error

        var green = toString(msg.reactions.cache.get('๐ŸŸฉ').count);
                                                          ^

TypeError: Cannot read properties of undefined (reading 'count')

Please help!

I want it to display how many people reacted on ๐ŸŸฉ and ๐ŸŸฅ.

I'm not able to do that even after asking Discord.js experts, I can't understand how to get them.

I also want them to be a string, that's why I used The toString() function.

This is for a poll/vote bot I am making.

I react to the messages and still it shows this error.

This is Discord.js v13.

Thanks!

TheThiefingKing

about 4 years ago ยท Juan Pablo Isaza
1 answers
Answer question

0


let msg = await message.channel.messages.fetch("974311411314475059")
let reactsSize = msg.reactions.cache.get("โœ…").count
message.channel.send("โœ… Reacts on that message is: " + (+reactsSize))

You need to await message first after that you can fetch reactions.

about 4 years ago ยท Juan Pablo Isaza Report
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!