133
rated 0 times
[
137]
[
4]
/ answers: 1 / hits: 6227
/ 4 Years ago, thu, september 3, 2020, 12:00:00
I have a bot that takes a mention and returns some user information:
bot.on('message', async message => {
let usr = bot.users.fetch(message.replace('<@!', '').replace('>', ''));
message.channel.send(`id: ${usr.id}nname: ${usr.username}`);
});
However, the bot returns undefined for both values. I have logged the user object, and revieved
Promise {
User {
id: '',
username: '',
bot: false,
discriminator: '',
avatar: '',
lastMessageId: '',
LastMessage: '',
}
}
The values are different, but the objects are the same. I tried using usr.Promise.User.value
, usr.User.value
, and usr.Promise.value
with no luck. Is there some way to do this?
More From » discord