From 1a014d442580b2b8263394e1d5709ae49a46060d Mon Sep 17 00:00:00 2001 From: Dylan Dizon Date: Tue, 6 Nov 2018 13:23:17 -0500 Subject: [PATCH] Fix ctx.message deletion logic --- src/cogs/booru.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cogs/booru.py b/src/cogs/booru.py index 6bc8517..edd7bbc 100644 --- a/src/cogs/booru.py +++ b/src/cogs/booru.py @@ -418,12 +418,11 @@ class MsG: except exc.MatchError as e: await ctx.send('**No probable match for:** `{}`'.format(e)) - if remove: - with suppress(err.NotFound): - await ctx.message.delete() - if not c: await ctx.message.add_reaction('\N{CROSS MARK}') + else: + with suppress(err.NotFound): + await ctx.message.delete() except exc.MissingArgument: await ctx.send('**Invalid url or file.** Be sure the link directs to an image file')