🏗️ Built framework for games
This commit is contained in:
12
Gwendolyn.py
12
Gwendolyn.py
@ -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))
|
||||
|
Reference in New Issue
Block a user