From 39664a6217e89628142d5aa4ade7e209dbe25b45 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Tue, 8 May 2012 18:21:09 +1200 Subject: [PATCH] Added default command_prefix to code. --- core/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/main.py b/core/main.py index df47cd4..968a023 100755 --- a/core/main.py +++ b/core/main.py @@ -140,7 +140,7 @@ def match_command(command): def main(conn, out): inp = Input(conn, *out) - commandprefix = conn.conf.get('command_prefix') + commandprefix = conn.conf.get('command_prefix', '.') # EVENTS for func, args in bot.events[inp.command] + bot.events['*']: @@ -149,9 +149,9 @@ def main(conn, out): if inp.command == 'PRIVMSG': # COMMANDS if inp.chan == inp.nick: # private message, no command prefix - prefix = r'^(?:[' + commandprefix + ']?|' + prefix = '^(?:[%s]?|' % command_prefix else: - prefix = r'^(?:[' + commandprefix + ']|' + prefix = '^(?:[%s]|' % command_prefix command_re = prefix + inp.conn.nick command_re += r'[,;:]+\s+)(\w+)(?:$|\s+)(.*)'