discord.js First mention code example
Example 1: discord.js get first mention
let member = msg.members.mentions.first();
if(msg.content === 'name'){
msg.channel.send(member)
}
Example 2: check if message mentions users discord js
// 1st Way
if (<Message>.mentions.members.size) { // or message.mentions.members.size > 0
//DO STUFF
}
// 2nd Way
if (<Message>.mentions.members.first()) {
//DO STUFF
}