diff --git a/core/config.py b/core/config.py index ac8ebca..f92b16a 100644 --- a/core/config.py +++ b/core/config.py @@ -19,6 +19,7 @@ if not os.path.exists('config'): "channels": ["#test"] } }, + "prefix": ".", "disabled_plugins": [], "disabled_commands": [], "acls": {}, diff --git a/core/main.py b/core/main.py index b8fa3d2..38ebfa8 100644 --- a/core/main.py +++ b/core/main.py @@ -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+)(.*)'