add !up/!down as aliases of !op/!deop
This commit is contained in:
parent
cc02595056
commit
9ef732c592
1 changed files with 13 additions and 2 deletions
|
@ -123,13 +123,24 @@ class Module(ModuleManager.BaseModule):
|
||||||
self._kick(event["server"], event["target"], args[0], args[1:])
|
self._kick(event["server"], event["target"], args[0], args[1:])
|
||||||
|
|
||||||
@utils.hook("received.command.op")
|
@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("channel_only", True)
|
||||||
@utils.kwarg("require_mode", "o")
|
@utils.kwarg("require_mode", "o")
|
||||||
@utils.kwarg("require_access", "op")
|
@utils.kwarg("require_access", "op")
|
||||||
@utils.kwarg("usage", "[nickname]")
|
@utils.kwarg("usage", "[nickname]")
|
||||||
def op(self, event):
|
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[
|
target = event["args_split"][0] if event["args"] else event[
|
||||||
"user"].nickname
|
"user"].nickname
|
||||||
event["target"].send_mode("+o" if add else "-o", [target])
|
event["target"].send_mode("+o" if add else "-o", [target])
|
||||||
|
|
Loading…
Reference in a new issue