From fd51d44c705bda4c5ec4ccf99e085941fea459d8 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 9 Sep 2018 10:17:22 +0100 Subject: [PATCH] Utilise !serverset in more modules --- modules/accept_invite.py | 6 +++++- modules/check_urls.py | 3 +++ modules/commands.py | 2 ++ modules/ctcp.py | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/accept_invite.py b/modules/accept_invite.py index 671b76f4..6dd476e1 100644 --- a/modules/accept_invite.py +++ b/modules/accept_invite.py @@ -1,10 +1,14 @@ - +import Utils class Module(object): def __init__(self, bot, events, exports): events.on("received").on("invite").hook(self.on_invite) + exports.add("serverset", {"setting": "accept-invites", + "help": "Set whether I accept invites on this server", + "validate": Utils.bool_or_none}) def on_invite(self, event): if event["server"].is_own_nickname(event["target_user"].nickname): if event["server"].get_setting("accept-invites", True): event["server"].send_join(event["target_channel"]) + diff --git a/modules/check_urls.py b/modules/check_urls.py index e53437b7..221f548d 100644 --- a/modules/check_urls.py +++ b/modules/check_urls.py @@ -15,6 +15,9 @@ class Module(object): exports.add("channelset", {"setting": "check-urls", "help": "Enable/Disable automatically checking for " "malicious URLs", "validate": Utils.bool_or_none}) + exports.add("serverset", {"setting": "check-urls", + "help": "Enable/Disable automatically checking for " + "malicious URLs", "validate": Utils.bool_or_none}) exports.add("channelset", {"setting": "check-urls-kick", "help": "Enable/Disable automatically kicking users that " "send malicious URLs", "validate": Utils.bool_or_none}) diff --git a/modules/commands.py b/modules/commands.py index 21b0f361..a500c75d 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -70,6 +70,8 @@ class Module(object): exports.add("channelset", {"setting": "command-prefix", "help": "Set the command prefix used in this channel"}) + exports.add("serverset", {"setting": "command-prefix", + "help": "Set the command prefix used on this server"}) exports.add("serverset", {"setting": "identity-mechanism", "help": "Set the identity mechanism for this server"}) diff --git a/modules/ctcp.py b/modules/ctcp.py index e6d7ad8f..1a009d1d 100644 --- a/modules/ctcp.py +++ b/modules/ctcp.py @@ -1,10 +1,14 @@ import datetime +import Utils class Module(object): def __init__(self, bot, events, exports): self.bot = bot events.on("received").on("message").on("private").hook( self.private_message) + exports.add("serverset", {"setting": "ctcp-responses", + "help": "Set whether I respond to CTCPs on this server", + "validate": Utils.bool_or_none}) def private_message(self, event): if event["message"][0] == "\x01" and event["message"][-1] == "\x01":