diff options
| author | 2019-05-15 10:30:36 +0100 | |
|---|---|---|
| committer | 2019-05-15 10:30:36 +0100 | |
| commit | a80eda614db2705c119636ba452134c423e6278d (patch) | |
| tree | 20392119b955d1d3a1614faedec8556fd827786b /modules | |
| parent | msgid has been ratified (diff) | |
| signature | ||
Add IRCBot.SOURCE, use it in ctcp.py
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/ctcp.py | 8 |
1 files changed, 4 insertions, 4 deletions
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): |
