From 16c79859421650ef9c1cdfc24bb291d23c900fce Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 17 Oct 2017 00:41:58 -0400 Subject: [PATCH] Order of events logic with reactions --- src/main/cogs/booru.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/cogs/booru.py b/src/main/cogs/booru.py index 7ea6cf5..1d36417 100644 --- a/src/main/cogs/booru.py +++ b/src/main/cogs/booru.py @@ -152,8 +152,6 @@ class MsG: delete = False try: - await ctx.message.add_reaction('✅') - if arg == '-d' or arg == '-del' or arg == '-delete': delete = True elif arg is not None: @@ -206,6 +204,8 @@ class MsG: await ctx.send('**No probable match for:** `{}`'.format(e), delete_after=10) await message.add_reaction('❌') + await ctx.message.add_reaction('✅') + except exc.NotFound: await ctx.send('**No matches found.**', delete_after=10) await ctx.message.add_reaction('❌') @@ -220,8 +220,6 @@ class MsG: if not urls and not ctx.message.attachments: raise exc.MissingArgument - await ctx.message.add_reaction('✅') - for url in urls: try: await ctx.trigger_typing() @@ -248,6 +246,8 @@ class MsG: except exc.MatchError as e: await ctx.send('**No probable match for:** `{}`'.format(e), delete_after=10) + await ctx.message.add_reaction('✅') + except exc.MissingArgument: await ctx.send('**Invalid url or file.**', delete_after=10) await ctx.message.add_reaction('❌') @@ -260,8 +260,6 @@ class MsG: attachments = [] delete = False - await ctx.message.add_reaction('✅') - try: if arg == '-d' or arg == '-del' or arg == '-delete': delete = True @@ -319,6 +317,8 @@ class MsG: await ctx.send('**No probable match for:** `{}`'.format(e), delete_after=10) await message.add_reaction('❌') + await ctx.message.add_reaction('✅') + except exc.NotFound: await ctx.send('**No matches found.**', delete_after=10) await ctx.message.add_reaction('❌')