Fire an event when a user tries an unknown command
This commit is contained in:
parent
882bbdf0ff
commit
3f84c9871a
1 changed files with 8 additions and 0 deletions
|
@ -278,6 +278,10 @@ class Module(ModuleManager.BaseModule):
|
||||||
event["target_str"], True, event["user"], command,
|
event["target_str"], True, event["user"], command,
|
||||||
args_split, event["tags"], hook,
|
args_split, event["tags"], hook,
|
||||||
command_prefix=command_prefix)
|
command_prefix=command_prefix)
|
||||||
|
else:
|
||||||
|
self.events.on("unknown.command").call(server=event["server"],
|
||||||
|
target=event["channel"], user=event["user"],
|
||||||
|
command=command, command_prefix=command_prefix)
|
||||||
else:
|
else:
|
||||||
regex_hooks = self.events.on("command.regex").get_hooks()
|
regex_hooks = self.events.on("command.regex").get_hooks()
|
||||||
for hook in regex_hooks:
|
for hook in regex_hooks:
|
||||||
|
@ -318,6 +322,10 @@ class Module(ModuleManager.BaseModule):
|
||||||
self.command(event["server"], event["user"],
|
self.command(event["server"], event["user"],
|
||||||
event["user"].nickname, False, event["user"], command,
|
event["user"].nickname, False, event["user"], command,
|
||||||
args_split, event["tags"], hook, command_prefix="")
|
args_split, event["tags"], hook, command_prefix="")
|
||||||
|
else:
|
||||||
|
self.events.on("unknown.command").call(server=event["server"],
|
||||||
|
target=event["user"], user=event["user"], command=command,
|
||||||
|
command_prefix="")
|
||||||
|
|
||||||
def _get_usage(self, hook, command, command_prefix=""):
|
def _get_usage(self, hook, command, command_prefix=""):
|
||||||
command = "%s%s" % (command_prefix, command)
|
command = "%s%s" % (command_prefix, command)
|
||||||
|
|
Loading…
Reference in a new issue