🎲 monopoly framework

This commit is contained in:
Nikolaj Danger
2020-08-05 18:15:45 +02:00
parent f9c9bcef1b
commit eaabb6d43f
12 changed files with 285 additions and 20 deletions

View File

@ -186,7 +186,7 @@ def replaceMultiple(mainString, toBeReplaces, newString):
return mainString
def emojiToNumber(emoji):
def emojiToCommand(emoji):
if emoji == "1":
return 1
elif emoji == "2":
@ -201,6 +201,8 @@ def emojiToNumber(emoji):
return 6
elif emoji == "7":
return 7
elif emoji == "🎲":
return "roll"
else: return ""
def fiarReactionTest(channel,message,user):
@ -223,16 +225,31 @@ def fiarReactionTest(channel,message,user):
else:
return False, 0
def monopolyReactionTest(channel,message):
with open("resources/games/oldImages/monopoly"+str(channel), "r") as f:
oldImage = int(f.read())
if message.id == oldImage:
logThis("They reacted to the monopoly game")
return True
else:
return False
def stopServer():
with open("resources/games/games.json","r") as f:
data = json.load(f)
games = json.load(f)
data["trivia questions"] = {}
data["blackjack games"] = {}
data["4 in a row games"] = {}
games["trivia questions"] = {}
games["blackjack games"] = {}
games["4 in a row games"] = {}
with open("resources/games/games.json","w") as f:
json.dump(data,f,indent=4)
json.dump(games,f,indent=4)
emptyDict = {}
with open("resources/games/monopolyGames.json", "w") as f:
json.dump(emptyDict,f,indent=4)
def deleteGame(gameType,channel):
with open("resources/games/games.json", "r") as f: