From 568d714fb2c17f67ebbff725efc8851f51ee870d Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 30 Aug 2018 11:40:41 +0100 Subject: [PATCH] Return config from Config.load_config instead of setting it on bot --- Config.py | 2 +- start.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Config.py b/Config.py index 21a144cf..894c9eb0 100644 --- a/Config.py +++ b/Config.py @@ -14,4 +14,4 @@ class Config(object): with open(self.full_location) as config_file: parser = configparser.ConfigParser() parser.read_string(config_file.read()) - self.bot.config = dict(parser["bot"].items()) + return dict(parser["bot"].items()) diff --git a/start.py b/start.py index 58ec6585..ae78855e 100755 --- a/start.py +++ b/start.py @@ -19,9 +19,10 @@ args = arg_parser.parse_args() bot = IRCBot.Bot() database = Database.Database(bot, args.database) -config_object = Config.Config(bot, args.config) +config = Config.Config(bot, args.config) + bot.database = database -bot.config_object = config_object +bot.config = config.load_config() bot.args = args bot.modules.load_modules()