mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-16 18:50:13 +00:00
Update member_commands.py
Add ability to get avatar image from an attachment
This commit is contained in:
parent
5590cfc90f
commit
efad860e87
1 changed files with 3 additions and 0 deletions
|
|
@ -128,6 +128,9 @@ async def member_avatar(ctx: CommandContext, member: Member):
|
|||
user = await utils.parse_mention(ctx.client, new_avatar_url)
|
||||
if user:
|
||||
new_avatar_url = user.avatar_url_as(format="png")
|
||||
|
||||
if not new_avatar_url and ctx.message.attachments[0]:
|
||||
new_avatar_url = ctx.message.attachments[0].url
|
||||
|
||||
await member.set_avatar(ctx.conn, new_avatar_url)
|
||||
await ctx.reply_ok("Member avatar {}.".format("updated" if new_avatar_url else "cleared"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue