Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,12 @@ def initial_setup():
for f in databases:
if not os.path.isfile(f"database/{f}.json"):
logger.warn(f"[main/Setup] '{f}.json' was not found in database directory. Creating new database...", module="main/Setup", nolog=True)
if f == "currency": open(f"database/{f}.json", 'x', encoding="utf-8").write('{"treasury": 1000000, "wallet": {}, "bank": {}}')
else: open(f"database/{f}.json", 'x', encoding="utf-8").write("{}")
if f == "currency":
with open(f"database/{f}.json", 'x', encoding="utf-8") as f:
json.dump({"treasury": 1000000, "wallet": {}, "bank": {}}, f, encoding="utf-8")
else:
with open(f"database/{f}.json", 'x', encoding="utf-8") as f:
json.dump({}, f, encoding="utf-8")
time.sleep(0.5)
except IOError as e:
logger.error(f"Failed to make database file: {e}", module="main/Setup")
Expand Down