🏗️ Built framework for games

This commit is contained in:
Nikolaj Danger
2020-07-27 17:18:07 +02:00
parent 6dac0e8bdf
commit 95d5fa685a
7 changed files with 31 additions and 29 deletions

View File

@ -53,12 +53,12 @@ async def on_message(message):
funcs.logThis(message.author.name+" ran \""+message.content+"\"")
await message.channel.send("Logging out...")
with open("resources/trivia.json","r") as f:
with open("resources/games.json","r") as f:
data = json.load(f)
data["questions"] = {}
data["trivia questions"] = {}
with open("resources/trivia.json","w") as f:
with open("resources/games.json","w") as f:
json.dump(data,f,indent=4)
await client.logout()
@ -254,11 +254,11 @@ async def on_message(message):
funcs.triviaCountPoints(str(message.channel))
with open("resources/trivia.json", "r") as f:
with open("resources/games.json", "r") as f:
data = json.load(f)
del data["questions"][str(message.channel)]
with open("resources/trivia.json", "w") as f:
del data["trivia questions"][str(message.channel)]
with open("resources/games.json", "w") as f:
json.dump(data,f,indent=4)
funcs.logThis("Time's up for the trivia question in "+str(message.channel))