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
[email protected] /home/edoardo/Desktop/Projects/Palermo/Volley
└── [email protected]
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 messageand 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