diff options
| author | 2019-06-16 20:45:14 +0100 | |
|---|---|---|
| committer | 2019-06-16 20:45:14 +0100 | |
| commit | 73aa55b866bded10e9d64c719268fc7dc08547ab (patch) | |
| tree | d0bd1c4e0b02ed71117f2f3da1c3c33740913714 | |
| parent | Allow command.regex hooks to opt-in to being triggered from a /me (diff) | |
| signature | ||
Support 'channel-access' check request referencing current channel
| -rw-r--r-- | modules/channel_access.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/channel_access.py b/modules/channel_access.py index 814fbe95..a15f983e 100644 --- a/modules/channel_access.py +++ b/modules/channel_access.py @@ -30,8 +30,13 @@ class Module(ModuleManager.BaseModule): @utils.hook("check.command.channel-access") def check_command(self, event): - return self._command_check(event, event["check_args"][0], - event["check_args"][1]) + target = event["target"] + access = event["request_args"][0] + if len(event["request_args"]) > 1: + target = event["request_args"][0] + access = event["request_args"][1] + + return self._command_check(event, target, access) @utils.hook("received.command.access", min_args=1, channel_only=True) def access(self, event): |
