send is_channel kwarg on unknown.command event

This commit is contained in:
jesopo 2019-06-24 22:54:34 +01:00
parent 3f84c9871a
commit 7f0af15e2d

View file

@ -281,7 +281,8 @@ class Module(ModuleManager.BaseModule):
else: else:
self.events.on("unknown.command").call(server=event["server"], self.events.on("unknown.command").call(server=event["server"],
target=event["channel"], user=event["user"], target=event["channel"], user=event["user"],
command=command, command_prefix=command_prefix) command=command, command_prefix=command_prefix,
is_channel=True)
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:
@ -325,7 +326,7 @@ class Module(ModuleManager.BaseModule):
else: else:
self.events.on("unknown.command").call(server=event["server"], self.events.on("unknown.command").call(server=event["server"],
target=event["user"], user=event["user"], command=command, target=event["user"], user=event["user"], command=command,
command_prefix="") command_prefix="", is_channel=False)
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)