set the error image to none up front instead of catching NameError
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0f8b18fd60
commit
50f8b14f95
1 file changed
+2
-7
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user