diff --git a/bot.py b/bot.py index 6b721b2..acaa882 100755 --- a/bot.py +++ b/bot.py @@ -15,9 +15,9 @@ import Queue import sys import time import platform +import re -sys.path += ['plugins'] # so 'import hook' works without duplication -sys.path += ['lib'] +sys.path += ['plugins', 'lib'] # so 'import hook' works without duplication os.chdir(sys.path[0] or '.') # do stuff relative to the install directory @@ -56,6 +56,9 @@ bot.conns = {} try: for name, conf in bot.config['connections'].iteritems(): + # strip all spaces and capitalization from the connection name + name = name.replace(" ", "_") + name = re.sub('[^A-Za-z0-9_]+', '', name).lower() print 'Connecting to server: %s' % conf['server'] if conf.get('ssl'): bot.conns[name] = SSLIRC(name, conf['server'], conf['nick'], conf=conf,