From 6eb8b1ba6d9aaaf7df42f3d705149f02b6a1b871 Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 27 Sep 2018 12:08:07 +0100 Subject: Move all exports to @Utils.export calls --- modules/channel_op.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'modules/channel_op.py') diff --git a/modules/channel_op.py b/modules/channel_op.py index 13f9df5a..81d00075 100644 --- a/modules/channel_op.py +++ b/modules/channel_op.py @@ -1,20 +1,18 @@ -from src import Utils +from src import ModuleManager, Utils -class Module(object): +@Utils.export("channelset", {"setting": "highlight-spam-threshold", + "help": "Set the number of nicknames in a message that qualifies as spam", + "validate": Utils.int_or_none}) +@Utils.export("channelset", {"setting": "highlight-spam-protection", + "help": "Enable/Disable highlight spam protection", + "validate": Utils.bool_or_none}) +@Utils.export("channelset", {"setting": "highlight-spam-ban", + "help": "Enable/Disable banning highlight spammers " + "instead of just kicking", "validate": Utils.bool_or_none}) +@Utils.export("channelset", {"setting": "ban-format", + "help": "Set ban format ($n = nick, $u = username, $h = hostname)"}) +class Module(ModuleManager.BaseModule): _name = "Channel Op" - def __init__(self, bot, events, exports): - exports.add("channelset", {"setting": "highlight-spam-threshold", - "help": "Set the number of nicknames in a message that " - "qualifies as spam", "validate": Utils.int_or_none}) - exports.add("channelset", {"setting": "highlight-spam-protection", - "help": "Enable/Disable highlight spam protection", - "validate": Utils.bool_or_none}) - exports.add("channelset", {"setting": "highlight-spam-ban", - "help": "Enable/Disable banning highlight spammers " - "instead of just kicking", "validate": Utils.bool_or_none}) - exports.add("channelset", {"setting": "ban-format", - "help": "Set ban format ($n = nick, $u = username, " - "$h = hostname)"}) @Utils.hook("received.command.kick|k", channel_only=True, require_mode="o", usage=" [reason]", min_args=1) -- cgit v1.3.1-10-gc9f91