Bug of discord.js Message.mentions.members . Doesn't include all mentioned members.
I am fetching a message by id and I am trying to read mentioned members in the message. The problem is it doesn't return all mentioned members.
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!npm list discord.js
volleyball@1.0.0 /home/edoardo/Desktop/Projects/Palermo/Volley
└── discord.js@14.15.3
node -v
v20.5.1
Here is the code:
Here is the output:
I have also notices that it doesn't recognise a user inside my server as a guild member
I have also tried changing the message![No description](https://cdn.answeroverflow.com/1263817516329734204/image.png)
and this is the output
I don't think fetching a message will populate those users into cache
Only the messageCreate event does
How can I solve this
Like should I consider users collection and then fetch for each user the guild member?
Doesn’t seem rate limit friendly if I increase users mentions
There could be 16 mentions
Already mentioned
So what should I do 😭
Wow didn’t know I could fetch multiple users
Thank you very much I’m changing the code
And I let u know if it worked
For a server of almost 30 k members I shouldn't cache right ?
It works , but it doesn't keep the order of mentions
Pls tell me there is a way other than using members...
I have also tried with regex , but fetching changes the order
I've verified that
is ordered
But fetch changes the order
solved but I don't know if it is overkill