Started work on argparse

This commit is contained in:
Logan Cusano
2022-02-18 23:45:18 -05:00
parent 4d742886b5
commit c68cdf9d7b

10
main.py
View File

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