Added config file not found exception

This commit is contained in:
Profitroll 2022-10-23 12:13:33 +02:00
parent 6fbc55727c
commit 2f0a955a07
1 changed files with 5 additions and 1 deletions

View File

@ -68,7 +68,11 @@ def configGet(key: str, *args: str, file: str = "config"):
* any: Value of provided key
"""
if file == "config":
this_dict = jsonLoad("config.json")
try:
this_dict = jsonLoad("config.json")
except FileNotFoundError:
print("Config file not found! Copy config_example.json to config.json, configure it and rerun the bot!")
exit()
else:
this_dict = jsonLoad(f"data{sep}users{sep}{file}.json")
this_key = this_dict