Fetching avatar and name from Discord ID
How can i get a discord avatar and a discord name just from their discord id, is there a way to fetch that? Or some url form where i need to put in the id for it to give me an avatar.
15 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!Node version: v22.12.0
[email protected]
:method: UserManager#fetch()
[email protected]
Obtains a user from Discord, or the user cache if it's already available.Fetch the user, it will have basic information available even if they don't share a server with the client
I still cant get it to work even tho i used the docs...
show your code
There you go.
you aren't supossed to make the url manually, just use the avatarURL method
Can you send an example of how i should do it in my code?
It would be super helpfull.
const url = discordUser.avatarURL()
alright thanks boss