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

ye
5 Replies
d.js toolkit
d.js toolkit12mo 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 🌈
chewie 🌈12mo ago
Generelly message.mentions.members returns a collection of pinged members Turning it to an array is pointless most of the time
Myz
Myz12mo ago
Okay, thanks i was doing message.mentions.first() what are the exceptions
chewie 🌈
chewie 🌈12mo ago
I dont know any