]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
+ MotdMessage class
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 12 Apr 2008 22:03:47 +0000 (00:03 +0200)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Sat, 12 Apr 2008 22:03:47 +0000 (00:03 +0200)
lib/rbot/ircbot.rb
lib/rbot/message.rb
lib/rbot/plugins.rb

index 12f087896a885e56e6c03d867bb5e6929faa5eb3..3d20b71df3c4578d77395e02f49306e65661863f 100644 (file)
@@ -586,9 +586,11 @@ class Bot
       @plugins.delegate "notice", message
     }
     @client[:motd] = proc { |data|
+      m = MotdMessage.new(self, server, data[:source], data[:target], data[:motd])
       data[:motd].each_line { |line|
         irclog "MOTD: #{line}", "server"
       }
+      @plugins.delegate "motd", m
     }
     @client[:nicktaken] = proc { |data|
       new = "#{data[:nick]}_"
index d923fd8efd6aed61478426cb8a9e3a1ef1234a49..616bef286e1ee9521febac7af1833093a11d9dbe 100644 (file)
@@ -219,6 +219,11 @@ module Irc
   class WelcomeMessage < BasicUserMessage
   end
 
+  # class for handling MOTD from the server. Yes, MotdMessage
+  # is somewhat redundant, but it fits with the naming scheme
+  class MotdMessage < BasicUserMessage
+  end
+
   # class for handling IRC user messages. Includes some utilities for handling
   # the message, for example in plugins.
   # The +message+ member will have any bot addressing "^bot: " removed
index ebefa3b6b702e9aabb45260bddb8866f8d44130d..631984c14a85147371f9797bdd718fd777b3f180 100644 (file)
@@ -126,6 +126,10 @@ module Plugins
                          Called when the welcome message is received on
                          joining a server succesfully.
 
+  motd(MotdMessage)::
+                         Called when the Message Of The Day is fully
+                         recevied from the server.
+
   connect::              Called when a server is joined successfully, but
                          before autojoin channels are joined (no params)