diff options
| author | 2020-01-13 16:32:45 +0000 | |
|---|---|---|
| committer | 2020-01-13 20:06:32 +0000 | |
| commit | 21694c39a50e4ac02391cffb9d69ebfb27ce5167 (patch) | |
| tree | 51e4561618c0469018d7d0f2cc635aff19e91a83 /src | |
| parent | !maskfind should work in-channel too (diff) | |
| signature | ||
allow !part to work for "current channel" when op/!access
Diffstat (limited to 'src')
| -rw-r--r-- | src/core_modules/admin.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core_modules/admin.py b/src/core_modules/admin.py index 364380d4..3a92dd39 100644 --- a/src/core_modules/admin.py +++ b/src/core_modules/admin.py @@ -33,18 +33,22 @@ class Module(ModuleManager.BaseModule): event["stderr"].write("Line was filtered") @utils.hook("received.command.part") + @utils.kwarg("help", "Part from the current or given channel") + @utils.kwarg("usage", "[channel]") def part(self, event): - """ - :help: Part from the current or given channel - :usage: [channel] - :permission: part - """ + check = utils.Check("permission", "part") + if event["args"]: target = event["args_split"][0] elif event["is_channel"]: target = event["target"].name + check |= utils.Check("channel-mode", "high") + check |= utils.Check("channel-access", "part") else: event["stderr"].write("No channel provided") + + event["check_assert"](check) + event["server"].send_part(target) def _id_from_alias(self, alias): |
