From e23444b757de3e6888bbdc009eae65cb4e670724 Mon Sep 17 00:00:00 2001 From: Abhijeet Kaur Date: Mon, 24 Jul 2017 02:15:20 +0530 Subject: [PATCH] bots: Fix errors to get info from config file to run bots. get_config_info function in 'ExternalBotHandler' class was using 2 undefined variables, which wasn't allowing bots to access information from config file. Fixed it, bots with api key working now. --- zulip_bots/zulip_bots/lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zulip_bots/zulip_bots/lib.py b/zulip_bots/zulip_bots/lib.py index 6369d6a..fbceca7 100644 --- a/zulip_bots/zulip_bots/lib.py +++ b/zulip_bots/zulip_bots/lib.py @@ -92,11 +92,11 @@ class ExternalBotHandler(object): def get_config_info(self, bot_name, section=None, optional=False): # type: (str, Optional[str], Optional[bool]) -> Dict[str, Any] conf_file_path = os.path.realpath(os.path.join( - our_dir, 'bots', bot_name, bot_name + '.conf')) + 'zulip_bots', 'bots', bot_name, bot_name + '.conf')) section = section or bot_name config = configparser.ConfigParser() try: - with open(config_file_path) as conf: + with open(conf_file_path) as conf: config.readfp(conf) # type: ignore except IOError: if optional: