Skip to content

Commit

Permalink
fix scrap bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Zennara committed Jan 13, 2022
1 parent ee9874e commit f96b5e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion database.json
Original file line number Diff line number Diff line change
@@ -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})}"
"{'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})}"
15 changes: 10 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("✅")
Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit f96b5e5

Please sign in to comment.