aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-24 22:53:28 +0100
committerGravatar jesopo2019-06-24 22:53:28 +0100
commit3f84c9871a4193919e94f9d1d7b60484b720264d (patch)
tree5834755a350688ef1c395f460934c4ef454efa84 /modules
parent'sucess_message' -> 'success_message' (diff)
signature
Fire an event when a user tries an unknown command
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/__init__.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py
index 2556d400..673e62ab 100644
--- a/modules/commands/__init__.py
+++ b/modules/commands/__init__.py
@@ -278,6 +278,10 @@ class Module(ModuleManager.BaseModule):
event["target_str"], True, event["user"], command,
args_split, event["tags"], hook,
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:
regex_hooks = self.events.on("command.regex").get_hooks()
for hook in regex_hooks:
@@ -318,6 +322,10 @@ class Module(ModuleManager.BaseModule):
self.command(event["server"], event["user"],
event["user"].nickname, False, event["user"], command,
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=""):
command = "%s%s" % (command_prefix, command)