Alias module: can create of aliases; fixes #27
This commit is contained in:
parent
1e139b3afa
commit
22b6392cc8
@ -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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user