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
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.