aboutsummaryrefslogtreecommitdiff
path: root/modules/channel_op.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-14 17:23:22 +0100
committerGravatar jesopo2019-06-14 17:23:22 +0100
commit229a45a4917586b55991960da792bbd729b9f643 (patch)
tree9332d5646152cd2aed7a375e3d0dc4c21e9c4efe /modules/channel_op.py
parent"saved a duck" -> "befriended a duck" (diff)
Change prviate channel_access commands to use a "channel-access" yield check
Diffstat (limited to 'modules/channel_op.py')
-rw-r--r--modules/channel_op.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/channel_op.py b/modules/channel_op.py
index f156d340..819911f6 100644
--- a/modules/channel_op.py
+++ b/modules/channel_op.py
@@ -53,11 +53,11 @@ class Module(ModuleManager.BaseModule):
"""
:help: Kick a user from the current channel
:usage: <nickname> [reason]
- :require_access: kick
- :channel_arg: 0
:prefix: Kick
"""
channel = event["server"].channels.get(event["args_split"][0])
+ yield utils.Check("channel-access", channel, "kick")
+
self._kick_command(event, channel, event["args_split"][1:])
@utils.hook("received.command.k", alias_of="kick")
@@ -105,10 +105,10 @@ class Module(ModuleManager.BaseModule):
"""
:help: Ban a user/hostmask from the current channel
:usage: <channel> <nickname/hostmask>
- :require_access: ban
- :channel_arg: 0
"""
channel = event["server"].channels.get(event["args_split"][0])
+ yield utils.Check("channel-access", channel, "ban")
+
self._ban(event["server"], channel, True, event["args_split"][1])
@utils.hook("received.command.ban", channel_only=True, min_args=1)
def ban(self, event):
@@ -179,10 +179,10 @@ class Module(ModuleManager.BaseModule):
"""
:help: Unban a user/hostmask from the current channel
:usage: <channel> <nickname/hostmask>
- :require_access: ban
- :channel_arg: 0
"""
channel = event["server"].channels.get(event["args_split"][0])
+ yield utils.Check("channel-access", channel, "ban")
+
self._ban(event["server"], channel, False, event["args_split"][1])
@utils.hook("received.command.unban", channel_only=True, min_args=1)