aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core_modules/commands/__init__.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core_modules/commands/__init__.py b/src/core_modules/commands/__init__.py
index a7b55f2b..e330e2c6 100644
--- a/src/core_modules/commands/__init__.py
+++ b/src/core_modules/commands/__init__.py
@@ -73,11 +73,12 @@ class Module(ModuleManager.BaseModule):
server.get_setting(COMMAND_METHOD,
self.bot.get_setting(COMMAND_METHOD, default))).upper()
- def _find_command_hook(self, server, target, is_channel, command, args):
+ def _find_command_hook(self, server, target, is_channel, command, user,
+ args):
if not self.has_command(command):
command_event = CommandEvent(command, args)
self.events.on("get.command").call(command=command_event,
- server=server, target=target, is_channel=is_channel)
+ server=server, target=target, is_channel=is_channel, user=user)
command = command_event.command
args = command_event.args
@@ -303,7 +304,8 @@ class Module(ModuleManager.BaseModule):
if command:
try:
hook, command, args_split = self._find_command_hook(
- event["server"], event["channel"], True, command, args)
+ event["server"], event["channel"], True, command,
+ event["user"], args)
except BadContextException:
event["channel"].send_message(
"%s: That command is not valid in a channel" %
@@ -361,7 +363,8 @@ class Module(ModuleManager.BaseModule):
try:
hook, command, args_split = self._find_command_hook(
- event["server"], event["user"], False, command, args)
+ event["server"], event["user"], False, command,
+ event["user"], args)
except BadContextException:
event["user"].send_message(
"That command is not valid in a PM")