@bot.command()
async def avatar(ctx, *, user: discord.Member = None):
author = ctx.author
if not user:
user = author # Get your avatar if you do not mention someone
if user.is_avatar_animated():
url = user.avatar_url_as(format="gif") # Check if it is a GIF
if not user.is_avatar_animated():
url = user.avatar_url_as(static_format="png") # If it is not a GIF = PNG
await ctx.send("{}'s avatar: {}".format(user.name, url)) # Output a link + picture
如果您只想获得用户的化身,可以使用以下方法:
相关问题 更多 >
编程相关推荐