Incorrect reaction.count
I'm getting a reaction.count of 1 after receiving a reaction add event despite the message having 17 of these reactions. What can I do to troubleshoot this? I'm calling on partial reactions when needed, though that's not the case here.
17 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Checking
reaction.message.reactions.cache
gives the same number
Same with reaction.message.reactions.resolve
I request most intents and all the partials that should be relevant
Discord js seems to legit completely believe this message has 1 reaction, I am very confused
Bump
Updating from 14.8 to 14.10 didn't helpCan you show a screenshot what number you mean exactly
@jr.0
Sure
So if I add a star to this particular message in a discord server
reaction.fetch()
Resolve the promise and .count should be accurate
Is reaction.fetch() needed even when the reaction is not partial?
No idea but its worth a try
After restarting your bot to test it, its always partial
Thats why the guide tells you to fetch the message and the reaction
So after calling .fetch, even when not partial, djs still thinks it has a count of 1
When my bot starts I'm fetching the first couple hundred messages in the channel to get them into the cache, otherwise it would be partial when the bot first starts up
Can you show your code
Yeah
And that's just attached to the messageReactionAdd event
This doesn't happen for most messages
It just seems there's a couple messages that are somehow haunted
Cant reproduce any of this
😅
I almost can't either, it works perfect 99.9% of the time
What about reaction.users.cache.size
Looks like that is also 1
Ok... I reacted from my phone instead of desktop and somehow the bot got the correct count
I am so confused
Ah and I reboot it and it's back to 1. If I spam the reaction eventually it gets the correct number though
Could it be a bug on discord's end?