From d6d8a08f97f8e53d43d1c8d978e7b662f63f3575 Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:28:57 +0530 Subject: [PATCH 1/2] Remove manually-generated serverconfig database --- .gitignore | 1 + database.json | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 database.json diff --git a/.gitignore b/.gitignore index 7e3104a..0dacca0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__ logs snipe.json editsnipe.json +database.json diff --git a/database.json b/database.json deleted file mode 100644 index 5b9889f..0000000 --- a/database.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "audit_channel": {} -} \ No newline at end of file From a599e4456d6dc57b7175473c21cea646e43c9aaf Mon Sep 17 00:00:00 2001 From: snipe <72265661+notsniped@users.noreply.github.com> Date: Mon, 29 Apr 2024 23:29:29 +0530 Subject: [PATCH 2/2] Auto-generate server configuration database upon initial bot setup --- Main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Main.py b/Main.py index b92aae2..e6653e5 100644 --- a/Main.py +++ b/Main.py @@ -33,12 +33,15 @@ def create_files(): open("logs/errors.log", 'x', encoding="utf-8") # Create database files - databases = ["snipe.json", "editsnipe.json"] + databases = ["snipe.json", "editsnipe.json", "database.json"] for db in databases: if not os.path.isfile(db): print(f"[!] \"{db}\" appears to be missing from directory. Creating file...") with open(db, 'x', encoding="utf-8") as f: - json.dump({}, f) + if db == "database.json": + json.dump({"audit_channel": {}}, f) + else: + json.dump({}, f) f.close() create_files()