Started work on argparse
This commit is contained in:
10
main.py
10
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'],
|
||||
|
||||
Reference in New Issue
Block a user