From 3768dba0fc5513fbf3631185a8c87d36b5339989 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sat, 12 Apr 2008 23:48:54 +0200 Subject: [PATCH] + delegate notice() for NoticeMessage --- data/rbot/plugins/nickserv.rb | 3 +-- lib/rbot/ircbot.rb | 1 + lib/rbot/plugins.rb | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/rbot/plugins/nickserv.rb b/data/rbot/plugins/nickserv.rb index 87688952..5e4f86a5 100644 --- a/data/rbot/plugins/nickserv.rb +++ b/data/rbot/plugins/nickserv.rb @@ -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 diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 29c0a116..12f08789 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -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| diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index d714fcf3..ebefa3b6 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -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. -- 2.39.2