Find avatar by an ID
How could I told to used a specifical user ID (not the one who do the command but a specific ID set in the config before (so no option) and make it extract the avatar and name and other ?
5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Discord.js : 14.15.2
Node : 20.12.1
You can use
<Client>.users.fetch("userId")
to get a User object of someone with their ID, which includes avatar-related data, username, etc.:method: UserManager#fetch
@14.15.2
Obtains a user from Discord, or the user cache if it's already available.I beg in programmation and with discord. J's and j's. It's not the first time but I try to do the most of myself may if it's the simple things to discover, but my short experience give me some difficulties
I discover the documentation, how to use it and other so I try to do my best
Thanks for help <3