So I'm making a discord bot using discord.js v13, and there is a command where I would like the user to be able to mention multiple members in 1 message or use their ID. But I'm having some trouble with this. I've tried:
let UserID = message.mentions
console.log(UserID)
But this didn't log only the user IDs, it also console logged some other information. If you know how to get only the user IDs please let me know.
Thanks.
To get users you mentioned IDs, you need to use message.mentions.users.map and get such code as result:
let userIDs = message.mentions.users.map(m => m.id).join("\n")
console.log(userIDs)
P.S. If you also need users' nicknames use .map(m => m.username + " " + m.id)