Merge pull request #107 from craisins/master
Added support for custom bot prefixes
This commit is contained in:
commit
c14cc2d1b0
|
@ -19,6 +19,7 @@ if not os.path.exists('config'):
|
|||
"channels": ["#test"]
|
||||
}
|
||||
},
|
||||
"prefix": ".",
|
||||
"disabled_plugins": [],
|
||||
"disabled_commands": [],
|
||||
"acls": {},
|
||||
|
|
|
@ -163,10 +163,11 @@ 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'^(?:[.]?|'
|
||||
prefix = r'^(?:['+bot_prefix+']?|'
|
||||
else:
|
||||
prefix = r'^(?:[.]|'
|
||||
prefix = r'^(?:['+bot_prefix+']|'
|
||||
|
||||
command_re = prefix + inp.conn.nick
|
||||
command_re += r'[:,]+\s+)(\w+)(?:$|\s+)(.*)'
|
||||
|
|
Loading…
Reference in New Issue