🐛 games.json isn't written in await funcs
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
from .miscFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, replaceMultiple, emojiToNumber, fiarReactionTest
|
||||
from .miscFuncs import helloFunc, cap, imageFunc, logThis, findWikiPage, makeFiles, replaceMultiple, emojiToNumber, fiarReactionTest, deleteGame, stopServer
|
||||
|
||||
from .swfuncs import *
|
||||
|
||||
|
@ -254,4 +254,23 @@ def fiarReactionTest(channel,message,user):
|
||||
logThis("It wasn't their turn")
|
||||
return False, 0
|
||||
else:
|
||||
return False, 0
|
||||
return False, 0
|
||||
|
||||
def stopServer():
|
||||
with open("resources/games/games.json","r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
data["trivia questions"] = {}
|
||||
data["blackjack games"] = {}
|
||||
data["4 in a row games"] = {}
|
||||
|
||||
with open("resources/games/games.json","w") as f:
|
||||
json.dump(data,f,indent=4)
|
||||
|
||||
def deleteGame(gameType,channel):
|
||||
with open("resources/games/games.json", "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
del data[gameType][channel]
|
||||
with open("resources/games/games.json", "w") as f:
|
||||
json.dump(data,f,indent=4)
|
||||
|
Reference in New Issue
Block a user