Uses channel ID istead of name

This commit is contained in:
NikolajDanger
2020-08-05 22:39:31 +02:00
parent c913e657d6
commit 65378fd6c4
3 changed files with 128 additions and 128 deletions

View File

@ -209,13 +209,13 @@ def fiarReactionTest(channel,message,user):
with open("resources/games/games.json", "r") as f:
data = json.load(f)
with open("resources/games/oldImages/fourInARow"+str(channel), "r") as f:
with open("resources/games/oldImages/fourInARow"+str(channel.id), "r") as f:
oldImage = int(f.read())
if message.id == oldImage:
logThis("They reacted to the fourinarow game")
turn = data["4 in a row games"][str(channel)]["turn"]
if user == data["4 in a row games"][str(channel)]["players"][turn]:
turn = data["4 in a row games"][str(channel.id)]["turn"]
if user == data["4 in a row games"][str(channel.id)]["players"][turn]:
return True, turn+1
else:
logThis("It wasn't their turn")
@ -224,7 +224,7 @@ def fiarReactionTest(channel,message,user):
return False, 0
def monopolyReactionTest(channel,message):
with open("resources/games/oldImages/monopoly"+str(channel), "r") as f:
with open("resources/games/oldImages/monopoly"+str(channel.id), "r") as f:
oldImage = int(f.read())
if message.id == oldImage: