Skip to content

Commit

Permalink
Autogenerate settings.json config file when performing bot client i…
Browse files Browse the repository at this point in the history
…nitial setup
  • Loading branch information
notsniped committed Apr 25, 2024
1 parent 8ca1b9c commit ff28972
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ def initial_setup():
except IOError as e:
logger.error(f"Failed to make database file: {e}", module="main/Setup")

# Generating other files
try:
if not os.path.isfile(f"config/settings.json"):
logger.warn(f"[main/Setup] Settings database file was not found in config directory. Creating new database...", module="main/Setup", nolog=True)
with open(f"config/settings.json", 'x', encoding="utf-8") as f:
json.dump({}, f)
f.close()
except IOError as e:
logger.error(f"Failed to make settings database file: {e}", module="main/Setup")

# Generating client log files
try:
if not os.path.isfile("logs/info-log.txt"):
Expand Down

0 comments on commit ff28972

Please sign in to comment.