Added config file not found exception
This commit is contained in:
parent
6fbc55727c
commit
2f0a955a07
@ -68,7 +68,11 @@ def configGet(key: str, *args: str, file: str = "config"):
|
|||||||
* any: Value of provided key
|
* any: Value of provided key
|
||||||
"""
|
"""
|
||||||
if file == "config":
|
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:
|
else:
|
||||||
this_dict = jsonLoad(f"data{sep}users{sep}{file}.json")
|
this_dict = jsonLoad(f"data{sep}users{sep}{file}.json")
|
||||||
this_key = this_dict
|
this_key = this_dict
|
||||||
|
Reference in New Issue
Block a user