From ae9d099a41b703ce875cf8746a94b6995bbaedfb Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 28 Jun 2019 23:16:05 +0100 Subject: Refactor set/channelset/serverset/botset in to 'utils.Setting' objects --- modules/check_urls.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'modules/check_urls.py') diff --git a/modules/check_urls.py b/modules/check_urls.py index 1ea83ebc..c8e81642 100644 --- a/modules/check_urls.py +++ b/modules/check_urls.py @@ -8,16 +8,12 @@ from src import ModuleManager, utils URL_VIRUSTOTAL = "https://www.virustotal.com/vtapi/v2/url/report" RE_URL = re.compile(r"https?://\S+", re.I) -@utils.export("channelset", {"setting": "check-urls", - "help": "Enable/Disable automatically checking for malicious URLs", - "validate": utils.bool_or_none, "example": "on"}) -@utils.export("serverset", {"setting": "check-urls", - "help": "Enable/Disable automatically checking for malicious URLs", - "validate": utils.bool_or_none, "example": "on"}) -@utils.export("channelset", {"setting": "check-urls-kick", - "help": "Enable/Disable automatically kicking users that " - "send malicious URLs", "validate": utils.bool_or_none, - "example": "on"}) +@utils.export("channelset", utils.BoolSetting("check-urls", + "Enable/Disable automatically checking for malicious URLs")) +@utils.export("serverset", utils.BoolSetting("check-urls", + "Enable/Disable automatically checking for malicious URLs")) +@utils.export("channelset", utils.BoolSetting("check-urls-kick", + "Enable/Disable automatically kicking users that send malicious URLs")) class Module(ModuleManager.BaseModule): @utils.hook("received.message.channel") def message(self, event): -- cgit v1.3.1-10-gc9f91