diff options
| author | 2019-07-10 08:56:51 +0100 | |
|---|---|---|
| committer | 2019-07-10 08:57:08 +0100 | |
| commit | dc8c63c11b011d18ffe294306ea2ed68a7787d99 (patch) | |
| tree | a8d8f3749010e58f7503253934ef3997910f9ea2 /modules/channel_op.py | |
| parent | ircv3_botignore.py should use HIGH priority (diff) | |
| signature | ||
add ability to disable !mute for networks that dont support mutes
Diffstat (limited to 'modules/channel_op.py')
| -rw-r--r-- | modules/channel_op.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/channel_op.py b/modules/channel_op.py index 4b2dbe15..f7cbc484 100644 --- a/modules/channel_op.py +++ b/modules/channel_op.py @@ -20,7 +20,8 @@ class InvalidTimeoutException(Exception): "Set ban format ($n = nick, $u = username, $h = hostname)", example="*!$u@$h")) @utils.export("serverset", utils.OptionsSetting("mute-method", - ["qmode", "insp", "unreal"], "Set this server's method of muting users")) + ["qmode", "insp", "unreal", "none"], + "Set this server's method of muting users")) class Module(ModuleManager.BaseModule): _name = "ChanOp" @@ -319,6 +320,8 @@ class Module(ModuleManager.BaseModule): return "b", "m:%s" % mask elif mute_method == "unreal": return "b", "~q:%s" % mask + elif mute_method == "none": + return None, None raise ValueError("Unknown mute-method '%s'" % mute_method) @utils.hook("received.command.mute", usage="<nickname> [duration]") @@ -341,6 +344,8 @@ class Module(ModuleManager.BaseModule): raise utils.EventError("No such user") mode, mask = self._mute_method(event["server"], target_user) + if mode == None: + raise utils.EventError("This network doesn't support mutes") if add and len(event["args_split"]) > 1: duration = utils.from_pretty_time(event["args_split"][1]) |
