From 1810055ccc7d9f6d686428ec9c0451ef1e8f503e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Mon, 24 Dec 2012 15:47:17 +0100 Subject: [PATCH] Alias module: detect alias only if line begins with ! --- modules/alias/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/alias/__init__.py b/modules/alias/__init__.py index e3f30d2..3cf9c01 100644 --- a/modules/alias/__init__.py +++ b/modules/alias/__init__.py @@ -118,9 +118,9 @@ def treat_variables(res): return True def treat_alias(msg, hooks_cache): - if msg.cmd == "PRIVMSG" and (len(msg.cmds[0]) > 0 and - msg.cmds[0][1:] in DATAS.getNode("aliases").index and - msg.cmds[0][1:] not in hooks_cache("cmd_hook")): + if msg.cmd == "PRIVMSG" and (len(msg.cmds[0]) > 0 and msg.cmds[0][0] == "!" + and msg.cmds[0][1:] in DATAS.getNode("aliases").index + and msg.cmds[0][1:] not in hooks_cache("cmd_hook")): msg.content = msg.content.replace(msg.cmds[0], DATAS.getNode("aliases").index[msg.cmds[0][1:]]["origin"], 1)