diff options
| author | 2019-01-29 08:06:59 +0000 | |
|---|---|---|
| committer | 2019-01-29 08:06:59 +0000 | |
| commit | 5d47e7e895606c43656506b77d4cbf3c365ad3d3 (patch) | |
| tree | 3296ebdb464c927feca9f89978863b1a4532398f /modules | |
| parent | Typo, 'acess' -> 'access' (channel_access.py) (diff) | |
| signature | ||
Add a `permission` to !ghwebhook so an admin user can use it without +o (github)
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/commands.py | 18 | ||||
| -rw-r--r-- | modules/github/module.py | 1 |
2 files changed, 9 insertions, 10 deletions
diff --git a/modules/commands.py b/modules/commands.py index 1b952fff..c2aae451 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -173,23 +173,21 @@ class Module(ModuleManager.BaseModule): hook=hook, user=event["user"], server=event["server"], target=target, is_channel=is_channel, tags=event["tags"]) - error = None + hard_fail = False force_success = False + error = None for returned in returns: if returned == utils.consts.PERMISSION_HARD_FAIL: - # denotes a "silent failure" - target.buffer.skip_next() - return + hard_fail = True elif returned == utils.consts.PERMISSION_FORCE_SUCCESS: force_success = True - break elif returned: - # error message error = returned - if error and not force_success: - stderr.write(error).send(command_method) - target.buffer.skip_next() - return + + if hard_fail or (not force_success and error): + if error: + stderr.write(error).send(command_method) + target.buffer.skip_next() if hook.kwargs.get("remove_empty", True): args_split = list(filter(None, args_split)) diff --git a/modules/github/module.py b/modules/github/module.py index 55abe233..6e413617 100644 --- a/modules/github/module.py +++ b/modules/github/module.py @@ -157,6 +157,7 @@ class Module(ModuleManager.BaseModule): """ :help: Add/remove/modify a github webhook :require_mode: high + :permission: githuboverride :usage: list :usage: add <hook> :usage: remove <hook> |
