Is it possible to get displayAvatarUrl from User interaction option?
My slack command has a User option requirement. From that, I am able to use interaction.options.getUser() to get the User information. But, I am unable to get the displayAvatarUrl.
19 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Can you show how you did it?
How I do what, exactly?
Get the user's avatar
I get the avatar string as part of the User object returned from interaction.options.getUser("user option")
How did you access the avatar exactly?
Did you just do
user.avatar
?Yes. But that just gives me the avatar string and not the avatar URL like displayAvatarURL would give.
Then use displayAvatarURL
Can you be more specific on why it’s not working
I am unable to get displayAvatarURL as part of the returned User object from
interaction.options.getUser("user option")
.Is there an error?
Did the program crash?
No. displayAvatarURL is literally not part of the User object returned.
Yes it is
User#displayAvatarURL()
A link to the user's avatar if they have one. Otherwise a link to their default avatar will be returned.
Not rly sure how you came to that conclusion
This is what is returned from the user object
Methods don’t appear in logs
It does in interaction logs
I think you're rightt tho.
Thank you
Well, unless you implemented some custom logger that magically extracts methods, which is doable but not common to do
I was able to grab the url from the method
Thank you Kinect