From a80eda614db2705c119636ba452134c423e6278d Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 15 May 2019 10:30:36 +0100 Subject: Add IRCBot.SOURCE, use it in ctcp.py --- modules/ctcp.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/ctcp.py b/modules/ctcp.py index 484d221e..092e8072 100644 --- a/modules/ctcp.py +++ b/modules/ctcp.py @@ -1,8 +1,6 @@ import datetime from src import IRCBot, ModuleManager, utils -VERSION_DEFAULT = "BitBot %s (https://git.io/bitbot)" % IRCBot.VERSION -SOURCE_DEFAULT = "https://git.io/bitbot" @utils.export("serverset", {"setting": "ctcp-responses", "help": "Set whether I respond to CTCPs on this server", @@ -10,13 +8,15 @@ SOURCE_DEFAULT = "https://git.io/bitbot" class Module(ModuleManager.BaseModule): @utils.hook("received.ctcp.version.private") def ctcp_version(self, event): + default = "BitBot %s (%s)" % (IRCBot.VERSION, IRCBot.SOURCE) + event["user"].send_ctcp_response("VERSION", - self.bot.config.get("ctcp-version", VERSION_DEFAULT)) + self.bot.config.get("ctcp-version", default)) @utils.hook("received.ctcp.source.private") def ctcp_source(self, event): event["user"].send_ctcp_response("SOURCE", - self.bot.config.get("ctcp-source", SOURCE_DEFAULT)) + self.bot.config.get("ctcp-source", IRCBot.SOURCE)) @utils.hook("received.ctcp.ping.private") def ctcp_ping(self, event): -- cgit v1.3.1-10-gc9f91