From c68cdf9d7b335e3a391f732d07b55505ff47d194 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Fri, 18 Feb 2022 23:45:18 -0500 Subject: [PATCH] Started work on argparse --- main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 76ea1e8..3c322b2 100644 --- a/main.py +++ b/main.py @@ -26,14 +26,20 @@ class BotDeviceNotFound(Exception): #os.execv(__file__, sys.argv) -def main(): +def main(**passed_config): print('Checking config file...') if not check_if_config_exists(): print("No config file exists, please enter this information now") - write_config_file(init=True) + write_config_file(init=True, **passed_config) config = read_config_file() + # Overwrite config options if they were passed + for sub in config: + # checking if key present in other dictionary + if sub in passed_config: + config[sub] = passed_config[sub] + print('Starting Bot...') discord_bot_client = bot.Bot(Token=config['Bot Token'], Device_ID=config['Device ID'], Device_Name=config['Device Name'],