Answers for "fetch user by id discordjs"

10

discord.js get user by id

client.users.cache.find(user => user.id === 'USER-ID')
Posted by: Guest on October-20-2020
0

discord js fetch user

//With .then
<client>.users.fetch('UserID').then((user) => {
	console.log(user);
}).catch(console.error);

//with async/await
const user = await <client>.users.fetch('UserID').catch(console.error);
console.log(user);
Posted by: Guest on January-21-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language