Hex so beautiful. And works!!!

This commit is contained in:
jona605a
2020-08-07 23:31:10 +02:00
parent b45aac1d1c
commit e6ce610366
3 changed files with 143 additions and 82 deletions

View File

@ -56,7 +56,7 @@ async def runHex(channel,command,user):
f.write(str(oldImage.id))
if gameDone:
with open("resources/games/games.json", "r") as f:
with open("resources/games/hexGames.json", "r") as f:
data = json.load(f)
try:
@ -66,11 +66,16 @@ async def runHex(channel,command,user):
except:
logThis("The old image was already deleted")
winner = data["hex games"][str(channel.id)]["winner"]
winner = data[str(channel.id)]["winner"]
if winner != 0:
addMoney(data["hex games"][str(channel.id)]["players"][winner-1].lower(),20)
addMoney(data[str(channel.id)]["players"][winner-1].lower(),20)
deleteGame("hex games",str(channel.id))
#deleteGame("hex games",str(channel.id))
with open("resources/games/hexGames.json", "r") as f:
data = json.load(f)
del data[str(channel.id)]
with open("resources/games/hexGames.json", "w") as f:
json.dump(data,f,indent=4)