From df90ba3a007b15b1c9503f5ca9547c52ab1e3f77 Mon Sep 17 00:00:00 2001 From: strNophix Date: Sat, 6 Nov 2021 16:08:19 +0100 Subject: [PATCH] take bot config as argument --- bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index bd991a8..117014a 100644 --- a/bot.py +++ b/bot.py @@ -110,7 +110,11 @@ class ChristmasBot(commands.Bot): await self.change_presence(activity=activity) -config = json.load(open("config.json", "r", encoding="utf-8")) +config_path = "config.json" +if len(sys.argv) > 1: + config_path = sys.argv[1] + +config = json.load(open(config_path, "r", encoding="utf-8")) redis_prefix = config["redis_prefix"] if __name__ == "__main__":