From fd75b712868b30ebb74714875c8d7437e4a1dbd6 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 27 Jan 2017 21:41:47 +0000 Subject: Adds args.verbose and fixes a couple of bug --- start.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'start.py') diff --git a/start.py b/start.py index 748a5089..848a2a08 100755 --- a/start.py +++ b/start.py @@ -13,6 +13,8 @@ arg_parser.add_argument("--config", "-c", default="bot.json", help="Location of the JSON config file") arg_parser.add_argument("--database", "-d", default="bot.db", help="Location of the sqlite3 database file") +arg_parser.add_argument("--verbose", "-v", action="store_true") + args = arg_parser.parse_args() bot = IRCBot.Bot() @@ -20,6 +22,7 @@ database = Database.Database(bot, args.database) config_object = Config.Config(bot, args.config) bot.database = database bot.config_object = config_object +bot.args = args bot.modules.load_modules() servers = database.get_servers() @@ -28,8 +31,8 @@ for server in servers: if len(bot.servers): bot.events.on("boot").on("done").call() time.sleep(5) - bot.connect_all() - bot.run() + if bot.connect_all(): + bot.run() else: try: if bool_input("no servers found, add one?"): -- cgit v1.3.1-10-gc9f91