diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/ircbot.rb | 2 | ||||
-rw-r--r-- | lib/rbot/message.rb | 5 | ||||
-rw-r--r-- | lib/rbot/plugins.rb | 4 |
3 files changed, 11 insertions, 0 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index 12f08789..3d20b71d 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -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]}_" diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index d923fd8e..616bef28 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -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 diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index ebefa3b6..631984c1 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -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) |