diff --git a/database.json b/database.json index 0ebc8ac..a3b1d7a 100644 --- a/database.json +++ b/database.json @@ -1 +1 @@ -"{'players': ObservedDict(value={'427968672980533269': ObservedDict(value={'scrap': 22, 'trading': '', '806706495466766366': ObservedList(value=['\ud83d\udc3b\\u200d\u2744\ufe0f|Uncommon|Sickly|Polar Bear|+0', '\ud83d\udcd5|Epic|Honest|Book|+0', '\ud83d\udca9|Rare|Virulent|Poop|+0', '\ud83c\udffa|Epic|Glowing High Quality|Amphora|+0']), '761036747504484392': ObservedList(value=['\ud83d\udc38|Common|Bawdy|Frog|+1'])}), '187227540962672640': ObservedDict(value={'scrap': 62, 'trading': '', '806706495466766366': ObservedList(value=[])}), '529381965804077067': ObservedDict(value={'scrap': 10, 'trading': '', '806706495466766366': ObservedList(value=['\ud83c\udf48|Common|Ultimate|Melon|+1'])})}), '806706495466766366': ObservedDict(value={'prefix': '!', 'name': \"Zenn's Dev Portal\", 'join': True}), '761036747504484392': ObservedDict(value={'prefix': '!', 'name': 'test this is', 'join': True})}" \ No newline at end of file +"{'players': ObservedDict(value={'427968672980533269': ObservedDict(value={'scrap': 105, 'trading': '', '806706495466766366': ObservedList(value=['\ud83e\udde6|Uncommon|Chilling|Socks|+2', '\ud83c\udf57|Uncommon|Spiky|Drumstick|+0']), '761036747504484392': ObservedList(value=['\ud83d\udc38|Common|Bawdy|Frog|+1'])}), '187227540962672640': ObservedDict(value={'scrap': 62, 'trading': '', '806706495466766366': ObservedList(value=[])}), '529381965804077067': ObservedDict(value={'scrap': 10, 'trading': '', '806706495466766366': ObservedList(value=['\ud83c\udf48|Common|Ultimate|Melon|+1'])})}), '761036747504484392': ObservedDict(value={'prefix': '!', 'name': 'test this is', 'join': True}), '806706495466766366': ObservedDict(value={'prefix': '!', 'name': \"Zenn's Dev Portal\", 'join': True})}" \ No newline at end of file diff --git a/main.py b/main.py index c4c6b23..29c56aa 100644 --- a/main.py +++ b/main.py @@ -698,11 +698,11 @@ def checkR(reaction, user): done = False def checkR(reaction, user): if not user.bot and user.id == message.author.id: + if str(reaction.emoji) == "✅": + asyncio.create_task(reaction.message.clear_reactions()) + return True if reaction.message == msg: - if str(reaction.emoji) == "✅": - asyncio.create_task(reaction.message.clear_reactions()) - return True - elif str(reaction.emoji) == "❌": + if str(reaction.emoji) == "❌": asyncio.create_task(reaction.message.clear_reactions()) return True await msg.add_reaction("✅") @@ -715,7 +715,11 @@ def checkR(reaction, user): break else: if str(reaction.emoji) == "✅": - break + if reaction.message == msg: + break + else: + done=True + break if str(reaction.emoji) == "❌": done = True break @@ -725,6 +729,7 @@ def checkR(reaction, user): embed = discord.Embed(description=scrapItem,color=0x000000,title="⚙️ Item was scrapped for "+ str(scrapAmount) +scrapEmoji) await msg.edit(embed=embed) else: + asyncio.create_task(msg.clear_reactions()) embed = discord.Embed(description="❌ Scrap cancelled.",color=0x000000) await msg.edit(embed=embed) else: