diff --git a/modules/alias.py b/modules/alias.py index cd5eb5e..7edd95b 100644 --- a/modules/alias.py +++ b/modules/alias.py @@ -154,17 +154,23 @@ def treat_variables(res): return True def treat_alias(msg, hooks_cache): - if msg.cmd == "PRIVMSG" and len(msg.cmds) > 0 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) + if msg.cmd == "PRIVMSG": + if len(msg.cmds) > 0 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) - msg.content = replace_variables(msg.content, msg) + msg.parse_content() - msg.parse_content() - return True + treat_alias(msg, hooks_cache) + return True + + else: + msg.content = replace_variables(msg.content, msg) + msg.parse_content() + return False return False