aboutsummaryrefslogtreecommitdiff
path: root/modules/channel_op.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-12-14 21:39:54 +0000
committerGravatar jesopo2019-12-14 21:40:59 +0000
commit9ef732c59264e813a26d16dd9790a185c7b6ba90 (patch)
treecff84dff2e967101cf947e61c8e935a2e99a44fb /modules/channel_op.py
parentmove internal.identified event call to _has_identified (covers hostmasks and (diff)
signature
add !up/!down as aliases of !op/!deop
Diffstat (limited to 'modules/channel_op.py')
-rw-r--r--modules/channel_op.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/channel_op.py b/modules/channel_op.py
index bc307778..60149f0c 100644
--- a/modules/channel_op.py
+++ b/modules/channel_op.py
@@ -123,13 +123,24 @@ class Module(ModuleManager.BaseModule):
self._kick(event["server"], event["target"], args[0], args[1:])
@utils.hook("received.command.op")
- @utils.hook("received.command.deop")
+ @utils.hook("received.command.up", alias_of="op")
@utils.kwarg("channel_only", True)
@utils.kwarg("require_mode", "o")
@utils.kwarg("require_access", "op")
@utils.kwarg("usage", "[nickname]")
def op(self, event):
- add = event["command"] == "op"
+ self._op(True, event)
+
+ @utils.hook("received.command.deop")
+ @utils.hook("received.command.down", alias_of="deop")
+ @utils.kwarg("channel_only", True)
+ @utils.kwarg("require_mode", "o")
+ @utils.kwarg("require_access", "op")
+ @utils.kwarg("usage", "[nickname]")
+ def deop(self, event):
+ self._op(False, event)
+
+ def _op(self, add, event):
target = event["args_split"][0] if event["args"] else event[
"user"].nickname
event["target"].send_mode("+o" if add else "-o", [target])