Init commit

This commit is contained in:
NikolajDanger
2020-03-22 00:29:34 +01:00
parent 3f5cacbef2
commit b95fe9270b
15 changed files with 24307 additions and 0 deletions

20
swchar.py Normal file
View File

@ -0,0 +1,20 @@
import json
def charData(user : str, key : str,cmd : str = ""):
with open("characters.json", "r") as f:
data = json.load(f)
if user in data:
if key in data[user]:
if cmd == "":
return data[user][key]
else:
data[user]["Name"] = cmd
with open("characters.json", "w") as f:
json.dump(data,f,indent = 4)
return "Changed " + user + "'s character's name to " + cmd
else:
return "Couldn't find that data. Are you sure you spelled it correctly?"
else:
return "You don't have a character. You can make one with !swchar"