I am currently developing a bot for Discord using discord.py.
The bot is triggered using Slash Commands. One of the parameter of my slash command is a user object. I need the URL of the user's avatar. I can get that by using the property avatar_url of the user object. It works just fine with regular users.
The problem comes with Nitro users. They can choose to have a special avatar depending on the guild they are on. When they choose to, the property avatar_url gives the "default" avatar, not the one currently in use in the guild.
I tried to use the Member object instead, but avatar_url still points to the default avatar, and not the guild-specific avatar.
# userobj is the user object given by the slash command
# context is the context object given by the slash command
member = context.guild.get_member(userobj.id)
if member:
print(userobj.avatar_url)
print(member.avatar_url) # They are the same
Do you know how I can get the URL of the guild-specific avatar of nitro users instead of the default avatar?