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'],