diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-09-02 07:16:33 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-09-02 07:16:33 +0000 |
commit | 57e7f0b22d7188c1d29c7b020a93450cda202ca8 (patch) | |
tree | 88f129c7619ddc53ad2e51cef6f489e619d7fcf4 /lib/rbot | |
parent | 703163e4bbff82051f9adf46177fb2f2ce6d6ba6 (diff) |
config botmodule: support CTCP commands VERSION and SOURCE
Diffstat (limited to 'lib/rbot')
-rw-r--r-- | lib/rbot/core/config.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/rbot/core/config.rb b/lib/rbot/core/config.rb index 7ff7a88c..717408a2 100644 --- a/lib/rbot/core/config.rb +++ b/lib/rbot/core/config.rb @@ -178,6 +178,18 @@ class ConfigModule < CoreBotModule m.reply version_string
end
+ def ctcp_listen(m)
+ who = m.private? ? "me" : m.target
+ case m.ctcp.intern
+ when :VERSION
+ m.ctcp_reply version_string
+ @bot.irclog "@ #{m.source} asked #{who} about version info"
+ when :SOURCE
+ m.ctcp_reply Irc::Bot::SOURCE_URL
+ @bot.irclog "@ #{m.source} asked #{who} about source info"
+ end
+ end
+
def handle_help(m, params)
m.reply help(params[:topic])
end
|