From 556d3bdfcc5cc91898758e2a991501869e7ec8c6 Mon Sep 17 00:00:00 2001 From: Sylte Date: Thu, 9 Nov 2023 09:11:21 +0100 Subject: [PATCH] Fix bug in /rank command The command would fail if the user has default avatar. --- bot/extensions/levelling/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/extensions/levelling/commands.py b/bot/extensions/levelling/commands.py index 09d80751..1e42b82e 100644 --- a/bot/extensions/levelling/commands.py +++ b/bot/extensions/levelling/commands.py @@ -282,7 +282,7 @@ async def rank(self, interaction: core.InteractionType, member: discord.Member = return await interaction.response.send_message("That user is not ranked yet...", ephemeral=True) # Fetch the user's avatar as bytes - avatar_bytes = await member.avatar.with_format("png").read() + avatar_bytes = await member.display_avatar.with_format("png").read() level = utils.get_level_for_xp(record.total_xp) prev_xp = utils.get_xp_for_level(level)