Issue with Fetching User Details from Reactions in Discord.js
Hi!
I'm encountering a challenge with retrieving user details from message reactions. Below is a detailed breakdown of my setup and the problem:
1. Discord.js and Node Versions:
- Discord.js Version: 14.13.0
- Node Version: 18.18.0
2. Bot Configuration:
- My bot is configured with the following intents and partials:
3. Process Reactions Function:
- The
processReactions
function, which is supposed to fetch reactions and their user details, is defined as:
4. Fetch Reaction Users Function:
- The fetchReactionUsers
function is intended to retrieve users from a given reaction:
5. Issue Description:
- Despite this setup, I'm unable to access the user details of the reactions. I successfully get the reactions, but the user information is not being retrieved as expected.
6. Request for Assistance:
- I would greatly appreciate any insights or suggestions on resolving this issue.
Thank you for your help!11 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!
- ✅
Marked as resolved by OPWhat is the issue? What do you expect?
I was expecting to get users who utilized the reaction.
So it returns an empty array?
yea
I can see emoji details and the message id but user array is empty
I assumed fetching them manually would populate that array but, still empty
Show the code how did you check it's empty
Oh did I post it incorrectly? I have it broken down in the original post. I essentially logged the contents of the fetchReactionUsers to the logger
It should return the users if there're some. Show how did you log it.
Currently using pino.
This is on the MessageReaction object.
I don't need the log. I need the code where you logged it and used
processReactions
or fetchReactionUsers
.Ah I see what happened, My issue was to iterate over the Collection<string,User> I assume I could just log the full object to the console. This works