I'm currently working on a Discord bot and I am in need of the user ID, specifically 'xxx', but I'm unsure of how to retrieve it.
Here is what I have tried so far: n.mentions.users.User. -- n.mentions.users.User()
This is what my code looks like:
bot.on('message', msg => {
if (msg.content === 'myId'){
msg.reply().then(n => {
console.log(n.mentions.users);
});
}
})
When I check the output, this is what I see:
Collection [Map] {
'1803209281398201380913' => User {
id: 'xxx',
username: 'zzz',
discriminator: '0000'
}
My expectation is to receive 'xxx', however, I am getting undefined instead.