Hook factorisation ; add new hooks : default (same comportement has previous version) and one hook before any parsing
When calling a hook, passed parameters change according to associated data variable
This commit is contained in:
parent
9ec07790ef
commit
7e20368c10
8 changed files with 109 additions and 63 deletions
|
|
@ -19,7 +19,7 @@ def load(context):
|
|||
context.hooks.add_hook(context.hooks.cmd_hook, Hook(cmd_syno, "synonyme"))
|
||||
|
||||
|
||||
def cmd_syno(data, msg):
|
||||
def cmd_syno(msg):
|
||||
if 1 < len(msg.cmd) < 6:
|
||||
for word in msg.cmd[1:]:
|
||||
synos = get_synos(word)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue