From 214a6d5a4933b975068b0272c98d178a47b487d5 Mon Sep 17 00:00:00 2001 From: Bella | Nightshade Date: Sat, 29 Jun 2019 20:12:17 +0930 Subject: [PATCH] Fix clear avatar bug Fixes a bug in member_avatar() where the bot will try to check for an attachment via list index when attachments do not exist. --- src/pluralkit/bot/commands/member_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pluralkit/bot/commands/member_commands.py b/src/pluralkit/bot/commands/member_commands.py index 5d335e4a..d74b2a63 100644 --- a/src/pluralkit/bot/commands/member_commands.py +++ b/src/pluralkit/bot/commands/member_commands.py @@ -129,7 +129,7 @@ async def member_avatar(ctx: CommandContext, member: Member): if user: new_avatar_url = user.avatar_url_as(format="png") - if not new_avatar_url and ctx.message.attachments[0]: + if not new_avatar_url and ctx.message.attachments: new_avatar_url = ctx.message.attachments[0].url await member.set_avatar(ctx.conn, new_avatar_url)