Koi
Koi
DIAdiscord.js - Imagine an app
Created by Koi on 3/7/2024 in #djs-questions
How to get the user id, username, nick when mentioned by another user
I tried m.mentions.members.first() but to no avail it didn't work as expected due to the mentions property being undefined despite mentioning someone. Any help would be appreciated! Here's the brief code:
module.exports = {

callback: async (m) => {

let user = m.member.nickname;
let mentionedUser = m.mentions.members.first();

if ( mentionedUser === undefined) {
m.channel.send("You need to mention someone!")
return;
}
m.channel.send(`${user} mentioned ${m.mentions.members.first()}`) //test
},
};
module.exports = {

callback: async (m) => {

let user = m.member.nickname;
let mentionedUser = m.mentions.members.first();

if ( mentionedUser === undefined) {
m.channel.send("You need to mention someone!")
return;
}
m.channel.send(`${user} mentioned ${m.mentions.members.first()}`) //test
},
};
19 replies