diff options
| author | 2019-01-30 19:35:43 +0000 | |
|---|---|---|
| committer | 2019-01-30 19:35:43 +0000 | |
| commit | 72072bbd3d936baaccd590b6326fdc2e0b056228 (patch) | |
| tree | 8c55b14839fcab3265ad01010350eea0efcf613d | |
| parent | check we have a `channel_arg` kwarg before parsing it as an int (diff) | |
| signature | ||
Make sure to call the specific hook we've decided is valid (commands.py)
| -rw-r--r-- | modules/commands.py | 15 | ||||
| -rw-r--r-- | src/EventManager.py | 2 |
2 files changed, 12 insertions, 5 deletions
diff --git a/modules/commands.py b/modules/commands.py index cf0f3207..53feb2d4 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -216,12 +216,17 @@ class Module(ModuleManager.BaseModule): args = " ".join(args_split) server = event["server"] user = event["user"] + + new_event = self.events.on("received.command").on(command + ).make_event(user=user, server=server, target=target, + args=args, tags=event["tags"], args_split=args_split, + stdout=stdout, stderr=stderr, command=command.lower(), + is_channel=is_channel) + + self.log.trace("calling command '%s': %s" % (command, + new_event.kwargs)) try: - self.events.on("received.command").on(command - ).call_unsafe_limited(1, user=user, server=server, - target=target, args=args, tags=event["tags"], - args_split=args_split, stdout=stdout, stderr=stderr, - command=command.lower(), is_channel=is_channel) + hook.call(new_event) except utils.EventError as e: stderr.write(str(e)) diff --git a/src/EventManager.py b/src/EventManager.py index cafedb4e..b83041c3 100644 --- a/src/EventManager.py +++ b/src/EventManager.py @@ -55,6 +55,8 @@ class EventHook(object): def _make_event(self, kwargs: dict) -> Event: return Event(self._get_path(), **kwargs) + def make_event(self, **kwargs): + return self._make_event(kwargs) def _get_path(self) -> str: path = [] |
