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
d.js toolkit
d.js toolkit•11mo ago
- 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!
Kinect3000
Kinect3000•11mo ago
Partial reactions may not have the count reaction.emoji is never partial
ManuelMaccou | Mosaic
ManuelMaccou | Mosaic•11mo ago
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:
if (reaction.partial) {
try {
await reaction.fetch();
} catch (error) {
console.error('Something went wrong when fetching the message: ', error);
return;
}
}

if (currentEmoji === '🚩' && isFirstMessage && message.reference === null) {
...
if (reaction.partial) {
try {
await reaction.fetch();
} catch (error) {
console.error('Something went wrong when fetching the message: ', error);
return;
}
}

if (currentEmoji === '🚩' && isFirstMessage && message.reference === null) {
...
But when the bot restarts, the reactions don't trigger the code. Do I need to replace something with reaction.emoji?
Kinect3000
Kinect3000•11mo ago
Fetching the reaction only gets the reaction.count If you need the message, you should be doing await reaction.message.fetch() instead
ManuelMaccou | Mosaic
ManuelMaccou | Mosaic•11mo ago
got it. Can i also get the user that made the reaction with reaction.user.fetch()?
Kinect3000
Kinect3000•11mo ago
reaction.user isn’t a thing user is provided as a separate parameter It’s never partial in this event