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
|
|
@ -8,7 +8,7 @@ from urllib.parse import quote
|
|||
|
||||
nemubotversion = 3.2
|
||||
|
||||
import module_states_file as xmlparser
|
||||
import xmlparser
|
||||
|
||||
LANG = ["ar", "zh", "cz", "en", "fr", "gr", "it",
|
||||
"ja", "ko", "pl", "pt", "ro", "es", "tr"]
|
||||
|
|
@ -25,7 +25,7 @@ def load(context):
|
|||
Hook(cmd_translate, "traduire"))
|
||||
|
||||
|
||||
def cmd_translate(data, msg):
|
||||
def cmd_translate(msg):
|
||||
global LANG
|
||||
startWord = 1
|
||||
if msg.cmd[startWord] in LANG:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue