bots: Check existance of config file in get_config_info().
MODIFY
bots/giphy/giphy.py
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=<giphy'
- 'API key here>\n\n')
- sys.exit(1)
-
-
class GiphyHandler(object):
'''
This plugin posts a GIF in response to the keywords provided by the user.

MODIFY
bots_api/bot_lib.py
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))

bots: Check existance of config file in get_config_info().