def main(): parser = argparse.ArgumentParser() parser.add_argument('-dev', action='store_true', help='use the dev database') args = parser.parse_args() Database.switch_database(Environment.LIVE) if args.dev: Database.switch_database(Environment.DEV) with open('config.json') as config_file: config = json.load(config_file) with setup_logging(): bot = SnipeBot(config) bot.run()
async def switchDB(self, ctx: commands.Context, env: Environment): Database.switch_database(env) await ctx.send('Database successfully changed.') print('Database: ' + Database.connection_string())