Merge pull request #123 from socram8888/master
Properly handle multicharacter bot prefixes
This commit is contained in:
commit
5e21e1b7b5
|
@ -175,10 +175,10 @@ def main(conn, out):
|
||||||
if inp.command == 'PRIVMSG':
|
if inp.command == 'PRIVMSG':
|
||||||
# COMMANDS
|
# COMMANDS
|
||||||
bot_prefix = re.escape(bot.config.get("prefix", "."))
|
bot_prefix = re.escape(bot.config.get("prefix", "."))
|
||||||
if inp.chan == inp.nick: # private message, no command prefix
|
if inp.chan == inp.nick: # private message, no command prefix required
|
||||||
prefix = r'^(?:['+bot_prefix+']?|'
|
prefix = r'^(?:(?:'+bot_prefix+')?|'
|
||||||
else:
|
else:
|
||||||
prefix = r'^(?:['+bot_prefix+']|'
|
prefix = r'^(?:'+bot_prefix+'|'
|
||||||
|
|
||||||
command_re = prefix + inp.conn.nick
|
command_re = prefix + inp.conn.nick
|
||||||
command_re += r'[:,]+\s+)(\w+)(?:$|\s+)(.*)'
|
command_re += r'[:,]+\s+)(\w+)(?:$|\s+)(.*)'
|
||||||
|
|
Loading…
Reference in New Issue