From 57e7f0b22d7188c1d29c7b020a93450cda202ca8 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 2 Sep 2007 07:16:33 +0000 Subject: [PATCH] config botmodule: support CTCP commands VERSION and SOURCE --- lib/rbot/core/config.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.39.5