2019-05-25 20:40:06 +00:00
|
|
|
#--depends-on channel_access
|
|
|
|
#--depends-on check_mode
|
|
|
|
#--depends-on commands
|
|
|
|
#--depends-on config
|
|
|
|
|
2018-10-03 12:22:37 +00:00
|
|
|
from src import ModuleManager, utils
|
2016-04-18 15:50:19 +00:00
|
|
|
|
2019-08-14 13:38:47 +00:00
|
|
|
KICK_REASON = "your behavior is not conducive to the desired environment"
|
2018-09-30 12:28:26 +00:00
|
|
|
|
2019-08-14 13:51:16 +00:00
|
|
|
KICK_REASON_SETTING = utils.Setting("default-kick-reason",
|
|
|
|
"Set the default kick reason", example="have a nice trip")
|
|
|
|
|
2019-06-28 22:16:05 +00:00
|
|
|
@utils.export("channelset", utils.Setting("ban-format",
|
2019-09-24 14:25:33 +00:00
|
|
|
"Set ban format ($n = nick, $u = username, $h = hostname, $a = account)",
|
2019-10-08 14:08:05 +00:00
|
|
|
|
2019-06-28 22:16:05 +00:00
|
|
|
example="*!$u@$h"))
|
2019-09-24 14:50:54 +00:00
|
|
|
@utils.export("channelset", utils.Setting("ban-format-account",
|
2019-10-08 14:08:05 +00:00
|
|
|
"Set ban format for users with accounts "
|
|
|
|
"($n = nick, $u = username, $h = hostname, $a = account)", example="~a:$a"))
|
2019-09-24 14:47:33 +00:00
|
|
|
|
2019-08-30 13:40:54 +00:00
|
|
|
@utils.export("serverset", utils.OptionsSetting(
|
|
|
|
["qmode", "insp", "unreal", "none"], "mute-method",
|
2019-07-10 07:56:51 +00:00
|
|
|
"Set this server's method of muting users"))
|
2019-08-14 13:51:16 +00:00
|
|
|
@utils.export("botset", KICK_REASON_SETTING)
|
|
|
|
@utils.export("serverset", KICK_REASON_SETTING)
|
|
|
|
@utils.export("channelset", KICK_REASON_SETTING)
|
2018-09-27 11:08:07 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
2019-08-14 14:08:17 +00:00
|
|
|
_name = "ChanOp"
|
|
|
|
|
2019-08-14 13:51:16 +00:00
|
|
|
def _kick_reason(self, server, channel):
|
|
|
|
return channel.get_setting("default-kick-reason",
|
|
|
|
server.get_setting("default-kick-reason",
|
|
|
|
self.bot.get_setting("default-kick-reson", KICK_REASON)))
|
|
|
|
|
2019-08-14 13:38:47 +00:00
|
|
|
def _kick(self, server, channel, target_nickname, reason):
|
|
|
|
target_user = server.get_user(target_nickname, create=False)
|
|
|
|
if target_user and channel.has_user(target_user):
|
2019-08-14 13:51:16 +00:00
|
|
|
reason = " ".join(reason) or self._kick_reason(server, channel)
|
2019-08-14 13:38:47 +00:00
|
|
|
channel.send_kick(target_user.nickname, reason)
|
2018-09-30 12:28:26 +00:00
|
|
|
else:
|
2019-08-14 13:38:47 +00:00
|
|
|
raise utils.EventError("No such user")
|
|
|
|
|
|
|
|
@utils.hook("received.command.kick")
|
2019-09-26 13:06:47 +00:00
|
|
|
@utils.hook("received.command.k", alias_of="kick")
|
2019-08-14 13:38:47 +00:00
|
|
|
@utils.kwarg("min_args", 1)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "kick")
|
|
|
|
@utils.kwarg("usage", "<nickname> [reason]")
|
2016-04-18 15:50:19 +00:00
|
|
|
def kick(self, event):
|
2019-08-14 13:38:47 +00:00
|
|
|
self._kick(event["server"], event["target"], event["args_split"][0],
|
|
|
|
event["args_split"][1:])
|
2016-04-18 15:50:19 +00:00
|
|
|
|
2019-08-14 13:38:47 +00:00
|
|
|
def _format_hostmask(self, user, s):
|
2019-09-24 14:27:35 +00:00
|
|
|
mask_split = s.split("$$")
|
|
|
|
for i, mask_part in enumerate(mask_split):
|
2019-09-24 14:57:23 +00:00
|
|
|
mask_split[i] = (mask_part.replace("$n", user.nickname)
|
2019-09-24 14:27:35 +00:00
|
|
|
.replace("$u", user.username)
|
|
|
|
.replace("$h", user.hostname)
|
2019-09-24 14:52:31 +00:00
|
|
|
.replace("$a", user.get_identified_account() or ""))
|
2019-09-24 14:27:35 +00:00
|
|
|
return "$".join(mask_split)
|
2019-08-14 13:38:47 +00:00
|
|
|
def _get_hostmask(self, channel, user):
|
2019-09-24 14:47:33 +00:00
|
|
|
if not user.get_identified_account() == None:
|
|
|
|
account_format = channel.get_setting("ban-format-account", None)
|
|
|
|
if not account_format == None:
|
|
|
|
return self._format_hostmask(user, account_format)
|
|
|
|
|
2019-08-14 13:38:47 +00:00
|
|
|
format = channel.get_setting("ban-format", "*!$u@$h")
|
2019-09-24 14:47:33 +00:00
|
|
|
return self._format_hostmask(user, format)
|
2019-08-14 13:38:47 +00:00
|
|
|
|
|
|
|
def _ban(self, server, channel, target, allow_hostmask, time, add):
|
|
|
|
hostmask = None
|
|
|
|
target_user = server.get_user(target, create=False)
|
|
|
|
if target_user and channel.has_user(target_user):
|
|
|
|
hostmask = self._get_hostmask(channel, target_user)
|
2018-07-19 13:39:10 +00:00
|
|
|
else:
|
2019-08-14 13:38:47 +00:00
|
|
|
if not allow_hostmask:
|
|
|
|
raise utils.EventError("No such user")
|
|
|
|
hostmask = target
|
|
|
|
if not add:
|
|
|
|
channel.send_unban(hostmask)
|
2018-09-30 12:28:26 +00:00
|
|
|
else:
|
2019-08-14 13:38:47 +00:00
|
|
|
channel.send_ban(hostmask)
|
2018-09-26 17:27:17 +00:00
|
|
|
|
2019-08-14 13:38:47 +00:00
|
|
|
if not time == None:
|
|
|
|
self.timers.add_persistent("unban", time, server_id=server.id,
|
|
|
|
channel_name=channel.name, hostmask=hostmask)
|
2019-06-15 17:42:14 +00:00
|
|
|
|
2019-08-14 13:38:47 +00:00
|
|
|
@utils.hook("timer.unban")
|
|
|
|
def _timer_unban(self, event):
|
|
|
|
server = self.bot.get_server_by_id(event["server_id"])
|
|
|
|
if server and event["channel_name"] in server.channels:
|
|
|
|
channel = server.channels.get(event["channel_name"])
|
|
|
|
channel.send_unban(event["hostmask"])
|
2019-06-14 16:23:22 +00:00
|
|
|
|
2019-08-14 13:38:47 +00:00
|
|
|
@utils.hook("received.command.ban")
|
2019-09-12 21:20:36 +00:00
|
|
|
@utils.hook("received.command.b", alias_of="ban")
|
2019-08-14 13:38:47 +00:00
|
|
|
@utils.kwarg("min_args", 1)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "ban")
|
|
|
|
@utils.kwarg("usage", "[+time] <target>")
|
2016-04-18 15:50:19 +00:00
|
|
|
def ban(self, event):
|
2019-11-18 15:56:44 +00:00
|
|
|
time, args = utils.parse.timed_args(event["args_split"], 1)
|
2019-08-14 13:38:47 +00:00
|
|
|
self._ban(event["server"], event["target"], args[0], True, time, True)
|
|
|
|
|
|
|
|
@utils.hook("received.command.unban")
|
|
|
|
@utils.kwarg("min_args", 1)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "ban")
|
|
|
|
@utils.kwarg("usage", "<target>")
|
2018-07-19 13:39:10 +00:00
|
|
|
def unban(self, event):
|
2019-08-14 13:38:47 +00:00
|
|
|
self._ban(event["server"], event["target"], event["args_split"][0],
|
|
|
|
True, None, False)
|
2016-04-18 15:50:19 +00:00
|
|
|
|
2019-08-14 13:38:47 +00:00
|
|
|
@utils.hook("received.command.kickban")
|
2018-10-10 09:42:41 +00:00
|
|
|
@utils.hook("received.command.kb", alias_of="kickban")
|
2019-08-14 13:38:47 +00:00
|
|
|
@utils.kwarg("min_args", 1)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "kickban")
|
|
|
|
@utils.kwarg("usage", "[+time] <nickname> [reason]")
|
2016-04-18 15:50:19 +00:00
|
|
|
def kickban(self, event):
|
2019-11-18 15:56:44 +00:00
|
|
|
time, args = utils.parse.timed_args(event["args_split"], 1)
|
2019-08-14 13:41:29 +00:00
|
|
|
self._ban(event["server"], event["target"], args[0], False, time, True)
|
2019-08-14 13:38:47 +00:00
|
|
|
self._kick(event["server"], event["target"], args[0], args[1:])
|
|
|
|
|
|
|
|
@utils.hook("received.command.op")
|
|
|
|
@utils.hook("received.command.deop")
|
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "op")
|
|
|
|
@utils.kwarg("usage", "[nickname]")
|
2016-04-22 10:48:28 +00:00
|
|
|
def op(self, event):
|
2019-09-10 11:59:52 +00:00
|
|
|
add = event["command"] == "op"
|
2019-08-14 13:38:47 +00:00
|
|
|
target = event["args_split"][0] if event["args"] else event[
|
|
|
|
"user"].nickname
|
2019-09-15 09:49:56 +00:00
|
|
|
event["target"].send_mode("+o" if add else "-o", [target])
|
2019-08-14 13:38:47 +00:00
|
|
|
|
|
|
|
@utils.hook("received.command.voice")
|
|
|
|
@utils.hook("received.command.devoice")
|
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "voice")
|
|
|
|
@utils.kwarg("usage", "[nickname]")
|
2019-08-30 11:26:52 +00:00
|
|
|
def voice(self, event):
|
2019-09-10 11:59:52 +00:00
|
|
|
add = event["command"] == "voice"
|
2019-08-14 13:38:47 +00:00
|
|
|
target = event["args_split"][0] if event["args"] else event[
|
|
|
|
"user"].nickname
|
2019-09-15 09:49:56 +00:00
|
|
|
event["target"].send_mode("+v" if add else "-v", [target])
|
2019-08-14 13:38:47 +00:00
|
|
|
|
|
|
|
@utils.hook("received.command.topic")
|
|
|
|
@utils.kwarg("min_args", 1)
|
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "topic")
|
|
|
|
@utils.kwarg("remove_empty", False)
|
|
|
|
@utils.kwarg("usage", "<topic>")
|
2018-09-06 16:25:38 +00:00
|
|
|
def topic(self, event):
|
|
|
|
event["target"].send_topic(event["args"])
|
2019-08-14 13:38:47 +00:00
|
|
|
|
|
|
|
@utils.hook("received.command.tappend")
|
|
|
|
@utils.kwarg("min_args", 1)
|
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "topic")
|
|
|
|
@utils.kwarg("remove_empty", False)
|
|
|
|
@utils.kwarg("usage", "<topic>")
|
2018-09-06 16:25:38 +00:00
|
|
|
def tappend(self, event):
|
|
|
|
event["target"].send_topic(event["target"].topic + event["args"])
|
|
|
|
|
2019-09-24 14:39:31 +00:00
|
|
|
def _mute_method(self, server, channel, user):
|
|
|
|
mask = self._get_hostmask(channel, user)
|
2019-06-27 19:52:32 +00:00
|
|
|
mute_method = server.get_setting("mute-method", "qmode").lower()
|
2019-06-27 19:38:39 +00:00
|
|
|
|
2019-06-27 19:52:32 +00:00
|
|
|
if mute_method == "qmode":
|
2019-06-27 19:38:39 +00:00
|
|
|
return "q", mask
|
2019-06-27 19:52:32 +00:00
|
|
|
elif mute_method == "insp":
|
2019-06-27 19:38:39 +00:00
|
|
|
return "b", "m:%s" % mask
|
2019-06-27 19:52:32 +00:00
|
|
|
elif mute_method == "unreal":
|
2019-06-27 19:38:39 +00:00
|
|
|
return "b", "~q:%s" % mask
|
2019-07-10 07:56:51 +00:00
|
|
|
elif mute_method == "none":
|
|
|
|
return None, None
|
2019-06-27 19:52:32 +00:00
|
|
|
raise ValueError("Unknown mute-method '%s'" % mute_method)
|
2019-06-27 19:38:39 +00:00
|
|
|
|
2019-08-14 14:07:48 +00:00
|
|
|
@utils.hook("received.command.mute", usage="[+time] <nickname>")
|
2019-06-27 19:52:32 +00:00
|
|
|
@utils.hook("received.command.unmute", usage="<nickname>")
|
2019-06-27 19:38:39 +00:00
|
|
|
@utils.kwarg("min_args", 1)
|
2019-06-27 20:09:26 +00:00
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "mute")
|
2019-06-27 19:52:32 +00:00
|
|
|
@utils.kwarg("help", "Mute a given user")
|
|
|
|
def _mute(self, event):
|
2019-09-10 11:59:52 +00:00
|
|
|
add = event["command"] == "mute"
|
2019-11-18 15:56:44 +00:00
|
|
|
time, args = utils.parse.timed_args(event["args_split"], 1)
|
2019-06-27 19:38:39 +00:00
|
|
|
|
2019-08-14 14:07:48 +00:00
|
|
|
target_name = args[0]
|
2019-06-27 19:38:39 +00:00
|
|
|
if not event["server"].has_user(target_name):
|
|
|
|
raise utils.EventError("No such user")
|
|
|
|
|
|
|
|
target_user = event["server"].get_user(target_name)
|
|
|
|
if not event["target"].has_user(target_user):
|
|
|
|
raise utils.EventError("No such user")
|
|
|
|
|
2019-09-24 14:39:31 +00:00
|
|
|
mode, mask = self._mute_method(event["server"], event["target"],
|
|
|
|
target_user)
|
2019-07-10 07:56:51 +00:00
|
|
|
if mode == None:
|
|
|
|
raise utils.EventError("This network doesn't support mutes")
|
2019-06-27 19:52:32 +00:00
|
|
|
|
2019-08-14 14:07:48 +00:00
|
|
|
if add and time:
|
|
|
|
self.timers.add_persistent("unmute", time,
|
2019-06-27 19:52:32 +00:00
|
|
|
server_id=event["server"].id, channel_name=event["target"].name,
|
|
|
|
mode=mode, mask=mask)
|
|
|
|
|
2019-06-27 19:38:39 +00:00
|
|
|
mode_modifier = "+" if add else "-"
|
|
|
|
event["target"].send_mode("%s%s" % (mode_modifier, mode), [mask])
|
2019-06-27 19:52:32 +00:00
|
|
|
|
|
|
|
@utils.hook("timer.unmute")
|
|
|
|
def _timer_unmute(self, event):
|
|
|
|
server = self.bot.get_server_by_id(event["server_id"])
|
|
|
|
if server and event["channel_name"] in server.channels:
|
|
|
|
channel = server.channels.get(event["channel_name"])
|
|
|
|
channel.send_mode("-%s" % event["mode"], [event["mask"]])
|
2019-09-12 09:24:10 +00:00
|
|
|
|
|
|
|
@utils.hook("received.command.invite")
|
|
|
|
@utils.kwarg("min_args", 1)
|
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "invite")
|
|
|
|
@utils.kwarg("help", "Invite a given user")
|
|
|
|
@utils.kwarg("usage", "<nickname>")
|
|
|
|
def invite(self, event):
|
|
|
|
user_nickname = event["args_split"][0]
|
|
|
|
|
|
|
|
event["target"].send_invite(user_nickname)
|
|
|
|
|
|
|
|
user = event["server"].get_user(user_nickname, create=False)
|
|
|
|
if user:
|
|
|
|
user_nickname = user.nickname
|
|
|
|
|
|
|
|
event["stdout"].write("Invited %s" % user_nickname)
|
2019-09-12 13:29:28 +00:00
|
|
|
|
|
|
|
def _parse_flags(self, s):
|
|
|
|
if s[0] == "+":
|
|
|
|
return True, list(s[1:])
|
|
|
|
elif s[0] == "-":
|
|
|
|
return False, list(s[1:])
|
|
|
|
else:
|
2019-09-12 22:13:02 +00:00
|
|
|
return None, None
|
2019-09-12 13:29:28 +00:00
|
|
|
|
|
|
|
@utils.hook("received.command.flags")
|
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("min_args", 1)
|
|
|
|
@utils.kwarg("help", "Configure access flags for a given user")
|
|
|
|
@utils.kwarg("usage", "<nickname> [flags]")
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "flags")
|
|
|
|
def flags(self, event):
|
|
|
|
target = event["server"].get_user(event["args_split"][0])
|
|
|
|
current_flags = event["target"].get_user_setting(target.get_id(),
|
|
|
|
"flags", "")
|
|
|
|
|
|
|
|
if len(event["args_split"]) == 1:
|
|
|
|
current_flags_str = ("+%s" % current_flags) if current_flags else ""
|
|
|
|
event["stdout"].write("Flags for %s: %s" % (target.nickname,
|
|
|
|
current_flags_str))
|
|
|
|
else:
|
|
|
|
is_add, parsed_flags = self._parse_flags(event["args_split"][1])
|
|
|
|
new_flags = None
|
|
|
|
|
|
|
|
if is_add == None:
|
|
|
|
raise utils.EventError("Invalid flags format")
|
|
|
|
elif is_add:
|
|
|
|
new_flags = list(set(list(current_flags)+parsed_flags))
|
|
|
|
else:
|
|
|
|
new_flags = list(set(current_flags)-set(parsed_flags))
|
|
|
|
|
|
|
|
if new_flags:
|
2019-09-12 14:00:00 +00:00
|
|
|
# sort alphanumeric with uppercase after lowercase
|
|
|
|
new_flags = sorted(new_flags,
|
2019-09-12 14:00:33 +00:00
|
|
|
key=lambda c: ("0" if c.islower() else "1")+c)
|
2019-09-12 14:00:00 +00:00
|
|
|
|
2019-09-12 13:29:28 +00:00
|
|
|
new_flags_str = "".join(new_flags)
|
|
|
|
event["target"].set_user_setting(target.get_id(), "flags",
|
|
|
|
new_flags_str)
|
2019-09-12 21:40:06 +00:00
|
|
|
|
|
|
|
self._check_flags(event["target"], target)
|
|
|
|
|
2019-09-12 13:29:28 +00:00
|
|
|
event["stdout"].write("Set flags for %s to +%s" % (
|
|
|
|
target.nickname, new_flags_str))
|
|
|
|
else:
|
|
|
|
event["target"].del_user_setting(target.get_id(), "flags")
|
|
|
|
event["stdout"].write("Cleared flags for %s" % target.nickname)
|
|
|
|
|
|
|
|
def _chunk(self, l, n):
|
|
|
|
return [l[i:i+n] for i in range(0, len(l), n)]
|
|
|
|
|
|
|
|
@utils.hook("received.join")
|
2019-09-12 13:55:26 +00:00
|
|
|
def on_join(self, event):
|
|
|
|
self._check_flags(event["channel"], event["user"])
|
|
|
|
@utils.hook("received.account.login")
|
|
|
|
@utils.hook("internal.identified")
|
|
|
|
def on_account(self, event):
|
|
|
|
for channel in event["user"].channels:
|
|
|
|
self._check_flags(channel, event["user"])
|
|
|
|
|
|
|
|
def _check_flags(self, channel, user):
|
|
|
|
flags = channel.get_user_setting(user.get_id(), "flags", "")
|
2019-09-12 21:40:23 +00:00
|
|
|
|
2019-09-12 13:55:26 +00:00
|
|
|
if flags:
|
|
|
|
identified = not user.get_identified_account() == None
|
2019-09-12 21:40:23 +00:00
|
|
|
current_modes = channel.get_user_modes(user)
|
2019-09-12 13:55:26 +00:00
|
|
|
|
2019-09-12 21:40:23 +00:00
|
|
|
modes = []
|
|
|
|
kick_reason = None
|
2019-09-12 13:55:26 +00:00
|
|
|
for flag in list(flags):
|
2019-09-12 21:40:23 +00:00
|
|
|
if flag == "O" and identified:
|
2019-09-12 13:55:26 +00:00
|
|
|
modes.append(("o", user.nickname))
|
2019-09-12 21:40:23 +00:00
|
|
|
elif flag == "V" and identified:
|
2019-09-12 13:55:26 +00:00
|
|
|
modes.append(("v", user.nickname))
|
|
|
|
elif flag == "b":
|
|
|
|
modes.append(("b", self._get_hostmask(channel, user)))
|
|
|
|
kick_reason = "User is banned from this channel"
|
|
|
|
|
2019-09-12 21:40:23 +00:00
|
|
|
new_modes = []
|
|
|
|
for mode, arg in modes:
|
|
|
|
if not mode in current_modes:
|
|
|
|
new_modes.append((mode, arg))
|
|
|
|
|
2019-09-12 14:13:42 +00:00
|
|
|
# break up in to chunks of (maximum) 3
|
|
|
|
# https://tools.ietf.org/html/rfc2812.html#section-3.2.3
|
2019-09-12 21:40:23 +00:00
|
|
|
for chunk in self._chunk(new_modes, 3):
|
2019-09-12 13:55:26 +00:00
|
|
|
chars, args = list(zip(*chunk))
|
|
|
|
channel.send_mode("+%s" % "".join(chars), list(args))
|
|
|
|
if not kick_reason == None:
|
|
|
|
channel.send_kick(user.nickname, kick_reason)
|
2019-10-25 17:30:57 +00:00
|
|
|
|
|
|
|
@utils.hook("received.command.cmute")
|
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "cmute")
|
|
|
|
@utils.kwarg("usage", "[+time]")
|
|
|
|
@utils.kwarg("help", "Mute the current channel")
|
|
|
|
def cmute(self, event):
|
2019-11-18 15:56:44 +00:00
|
|
|
time, args = utils.parse.timed_args(event["args_split"], 0)
|
2019-10-25 17:30:57 +00:00
|
|
|
event["target"].send_mode("+m")
|
|
|
|
|
|
|
|
if time:
|
|
|
|
self.timers.add_persistent("cunmute", time,
|
|
|
|
server_id=event["server"].id, channel_name=event["target"].name)
|
|
|
|
@utils.hook("timer.cunmute")
|
|
|
|
def cunmute_timer(self, event):
|
|
|
|
server = self.bot.get_server_by_id(event["server_id"])
|
|
|
|
if server and event["channel_name"] in server.channels:
|
|
|
|
self._cunmute(server.channels.get(event["channel_name"]))
|
|
|
|
|
|
|
|
@utils.hook("received.command.cunmute")
|
|
|
|
@utils.kwarg("channel_only", True)
|
|
|
|
@utils.kwarg("require_mode", "o")
|
|
|
|
@utils.kwarg("require_access", "cmute")
|
|
|
|
@utils.kwarg("usage", "[+time]")
|
|
|
|
@utils.kwarg("help", "Mute the current channel")
|
|
|
|
def cunmute(self):
|
|
|
|
self._cunmute(event["target"])
|
|
|
|
|
|
|
|
def _cunmute(self, channel):
|
|
|
|
channel.send_mode("-m")
|