]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
+ delegate notice() for NoticeMessage
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 12 Apr 2008 21:48:54 +0000 (23:48 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 12 Apr 2008 21:48:54 +0000 (23:48 +0200)
data/rbot/plugins/nickserv.rb
lib/rbot/ircbot.rb
lib/rbot/plugins.rb

index 8768895282c1f85760055f639e842f48c648b69f..5e4f86a5af0487285878d5f3aa48645283439f15 100644 (file)
@@ -179,8 +179,7 @@ class NickServPlugin < Plugin
     end
   end
 
-  def listen(m)
-    return unless(m.kind_of? NoticeMessage)
+  def notice(m)
     return unless m.source.downcase == ns_nick.downcase
 
     case m.message
index 29c0a116990dcbbc36b2ad60ec77309fd3d3090f..12f087896a885e56e6c03d867bb5e6929faa5eb3 100644 (file)
@@ -583,6 +583,7 @@ class Bot
       message = NoticeMessage.new(self, server, data[:source], data[:target], data[:message])
       # pass it off to plugins that want to hear everything
       @plugins.delegate "listen", message
+      @plugins.delegate "notice", message
     }
     @client[:motd] = proc { |data|
       data[:motd].each_line { |line|
index d714fcf3ca1c2ce598bb2c552a48a57f87af4e5e..ebefa3b6b702e9aabb45260bddb8866f8d44130d 100644 (file)
@@ -96,6 +96,10 @@ module Plugins
   unreplied(PrivMessage)::
                          Called for a PRIVMSG which has not been replied to.
 
+  notice(NoticeMessage)::
+                         Called for all Notices. Please notice that in general
+                         should not be replied to.
+
   kick(KickMessage)::
                          Called when a user (or the bot) is kicked from a
                          channel the bot is in.