]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
+ ctcp_listen plugin delegate
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 2 Sep 2007 07:16:17 +0000 (07:16 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sun, 2 Sep 2007 07:16:17 +0000 (07:16 +0000)
lib/rbot/ircbot.rb
lib/rbot/plugins.rb

index fd34667097fb834dc657949a2c89dbebb55888f7..f1f39f30257db073d5844e9945e7a1edbd543d14 100644 (file)
@@ -1,3 +1,8 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: rbot core
+
 require 'thread'
 
 require 'etc'
@@ -539,8 +544,9 @@ class Bot
 
       unless ignored
         @plugins.delegate "listen", m
+        @plugins.delegate("ctcp_listen", m) if m.ctcp
         @plugins.privmsg(m) if m.address?
-       if not m.replied
+        if not m.replied
           @plugins.delegate "unreplied", m
         end
       end
index 99ae31b6f03db8ddd2d7ed32493879ca3ec409cb..061c6a73b3b7d4d5ce033d65cb0474dd11b1022f 100644 (file)
@@ -1,3 +1,8 @@
+#-- vim:sw=2:et
+#++
+#
+# :title: rbot plugin management
+
 require 'singleton'
 
 module Irc
@@ -60,6 +65,13 @@ module Plugins
                          QuitMessage, PartMessage, JoinMessage, NickMessage,
                          etc.
 
+  ctcp_listen(UserMessage)::
+                         Called for all messages that contain a CTCP command.
+                         Use message.ctcp to get the CTCP command, and
+                         message.message to get the parameter string. To reply,
+                         use message.ctcp_reply, which sends a private NOTICE
+                         to the sender.
+
   privmsg(PrivMessage)::
                          Called for a PRIVMSG if the first word matches one
                          the plugin register()d for. Use m.plugin to get