diff --git a/bots/giphy/giphy.py b/bots/giphy/giphy.py index 5dd95cd..666d5e1 100644 --- a/bots/giphy/giphy.py +++ b/bots/giphy/giphy.py @@ -12,13 +12,6 @@ import re GIPHY_TRANSLATE_API = 'http://api.giphy.com/v1/gifs/translate' -if not os.path.exists(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'giphy.conf')): - print('Giphy bot config file not found, please set it up in this bot\'s folder ' - 'with the name \'giphy.conf\'\n\nUsing format:\n\n[giphy-config]\nkey=\n\n') - sys.exit(1) - - class GiphyHandler(object): ''' This plugin posts a GIF in response to the keywords provided by the user. diff --git a/bots_api/bot_lib.py b/bots_api/bot_lib.py index ecdccea..8fde0ac 100644 --- a/bots_api/bot_lib.py +++ b/bots_api/bot_lib.py @@ -102,7 +102,7 @@ class BotHandlerApi(object): our_dir, '..', 'bots', bot_name, bot_name + '.conf')) section = section or bot_name config = configparser.ConfigParser() - config.read(conf_file_path) + config.readfp(open(conf_file_path)) return dict(config.items(section))