From 4c970f6b16c93cf0ac2d2d58e32ac1336a9fda2a Mon Sep 17 00:00:00 2001 From: Marcos Vives Del Sol Date: Sun, 23 Nov 2014 16:19:56 +0100 Subject: [PATCH] Properly handle multicharacter bot prefixes --- core/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/main.py b/core/main.py index 22abb4a..73c7f4e 100644 --- a/core/main.py +++ b/core/main.py @@ -175,10 +175,10 @@ def main(conn, out): if inp.command == 'PRIVMSG': # COMMANDS bot_prefix = re.escape(bot.config.get("prefix", ".")) - if inp.chan == inp.nick: # private message, no command prefix - prefix = r'^(?:['+bot_prefix+']?|' + if inp.chan == inp.nick: # private message, no command prefix required + prefix = r'^(?:(?:'+bot_prefix+')?|' else: - prefix = r'^(?:['+bot_prefix+']|' + prefix = r'^(?:'+bot_prefix+'|' command_re = prefix + inp.conn.nick command_re += r'[:,]+\s+)(\w+)(?:$|\s+)(.*)'