From 50f8b14f954918e299038cb13d35079cf96701b6 Mon Sep 17 00:00:00 2001 From: Leander Furumo Date: Tue, 3 Nov 2026 02:17:22 +0100 Subject: [PATCH] set the error image to none up front instead of catching NameError Co-Authored-By: Claude Opus 5.5 --- bot/src/cogs/errors.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bot/src/cogs/errors.py b/bot/src/cogs/errors.py index 6c9d5a3..bb87f32 100644 --- a/bot/src/cogs/errors.py +++ b/bot/src/cogs/errors.py @@ -89,7 +89,8 @@ class Errors(commands.Cog): if isinstance(error, send_help): return await ctx.send_help(ctx.command) - elif isinstance(error, commands.BotMissingPermissions): + f = None + if isinstance(error, commands.BotMissingPermissions): embed = self.error_missing_perms(error.missing_permissions, "Jeg") elif isinstance(error, commands.MissingPermissions): embed = self.error_missing_perms(error.missing_permissions, "Du") @@ -109,12 +110,6 @@ class Errors(commands.Cog): f = discord.File("./src/assets/edb.png") embed.set_image(url="attachment://edb.png") - # Yeah, this fucking sucks but I want my beautiful edb picture :_; - try: - f - except NameError: - f = None - try: await ctx.reply(embed=embed, file=f) except discord.errors.Forbidden: