Creates swcharacters if it doesn't exist

This commit is contained in:
NikolajDanger
2020-04-01 14:44:43 +02:00
parent 934ffaa1c3
commit 43d4fca76f

View File

@ -5,9 +5,21 @@ import asyncio
import pickle
import codecs
import string
import json
import funcs
# Creates swcharacters.json if it doesn't exist
try:
f = open("resources/swcharacters.json","r")
except:
funcs.logThis("swcharacters.json didn't exist. Making it now.")
emptyDict = {}
with open("resources/swcharacters.json","w") as f:
json.dump(emptyDict,f,indent = 4)
finally:
f.close()
# Gets secret bot token
with open("token.txt","r") as f:
token = f.read().replace("\n","")