From 3243cd27711105b1c1fd0dd854514926a11933d0 Mon Sep 17 00:00:00 2001 From: "Dusty.P" Date: Wed, 9 May 2018 20:40:33 -0800 Subject: [PATCH] Clear Reactions after selection --- exts/uploader.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/exts/uploader.py b/exts/uploader.py index 6e0de7a..2aba246 100644 --- a/exts/uploader.py +++ b/exts/uploader.py @@ -1,4 +1,5 @@ import asyncio +import discord from discord.ext import commands from io import BytesIO from .imports import process_files, utils @@ -56,6 +57,10 @@ class Uploader: f'Canceling request due to timeout.') return else: + try: + await msg.clear_reactions() + except (discord.Forbidden, discord.HTTPException): + pass if str(reaction.emoji) == self.bot.unicode_emojis["o"]: await msg.edit(content="You chose to process as official.") await asyncio.sleep(4.0) @@ -87,7 +92,7 @@ class Uploader: game_msg.attachments[0].save(f) game_ini = process_files.process_file(f, 'game.ini') elif str(reaction.emoji) == self.bot.unicode_emojis['x']: - await msg.edit('Your request has been canceled.') + await msg.edit(content='Your request has been canceled.') return if official == 'official' and game_ini == ConfigParser(): @@ -109,6 +114,10 @@ class Uploader: f'Canceling request due to timeout.') return else: + try: + await msg.clear_reactions() + except (discord.Forbidden, discord.HTTPException): + pass if str(reaction.emoji) == self.bot.unicode_emojis["y"]: await msg.edit(content="You selected SinglePlayer.") await asyncio.sleep(4.0)