How to get a list of all pinged members in a message (not interaction)

ye
5 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
xoxo__cool_tabahi__xoxo
const mentionedMember = <Message>.mentions.members.map(mem=> mem)
const mentionedMember = <Message>.mentions.members.map(mem=> mem)
mentionedMember is an array of the members also alternatively too loop through each member you can use
<Message>.mentions.members?.forEach((mem)=>{
console.log(mem)
})
<Message>.mentions.members?.forEach((mem)=>{
console.log(mem)
})
chewie
chewie2y ago
Generelly message.mentions.members returns a collection of pinged members Turning it to an array is pointless most of the time
Myz
MyzOP2y ago
Okay, thanks i was doing message.mentions.first() what are the exceptions
chewie
chewie2y ago
I dont know any
Want results from more Discord servers?
Add your server