getting partials for reactions when only ID is guaranteed
I just saw this in the d.js docs
WARNING Partial data is only ever guaranteed to contain an ID! Do not assume any property or method to work when dealing with a partial structure!How for partial reactions, how do we make that work when regular emojis dont have an ID (unless I'm mistaken about that)
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Partial reactions may not have the count
reaction.emoji is never partial
Thanks. I'm still learning about partials, but does this mean that if my bot restarts, users should still be able to react to a message and the proper code will trigger?
For example, I have this code:
But when the bot restarts, the reactions don't trigger the code. Do I need to replace something with reaction.emoji?
Fetching the reaction only gets the reaction.count
If you need the message, you should be doing
await reaction.message.fetch()
insteadgot it. Can i also get the user that made the reaction with
reaction.user.fetch()
?reaction.user isn’t a thing
user is provided as a separate parameter
It’s never partial in this event