This commit is contained in:
NikolajDanger
2020-08-07 18:01:47 +02:00
parent 5839cd5a8f
commit 5a4eebdd7b
6 changed files with 14 additions and 14 deletions

View File

@ -6,7 +6,7 @@ from funcs import getName, logThis
def hangmanStart(channel,user):
with open("resources/games/hangmanGames.json", "r") as f:
data = json.load(f)
if channel not in data:
with urllib.request.urlopen("https://random-word-api.herokuapp.com/word?number=10") as p:
words = json.load(p)
@ -37,7 +37,7 @@ def parseHangman(channel,user,command):
del data[channel]
with open("resources/games/hangmanGames.json", "w") as f:
json.dump(data,f,indent=4)
return "Game stopped.", False, False, []
else:
return "I didn't understand that", False, False, []
return "I didn't understand that", False, False, []