summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-13 00:03:47 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2008-04-13 00:03:47 +0200
commit1f7b45bcfa05821884ba47d4e42608c8f9b5a6b1 (patch)
tree2f98737dd80079462a601d676bed6a91ecbea4b7 /lib
parent3768dba0fc5513fbf3631185a8c87d36b5339989 (diff)
+ MotdMessage class
Diffstat (limited to 'lib')
-rw-r--r--lib/rbot/ircbot.rb2
-rw-r--r--lib/rbot/message.rb5
-rw-r--r--lib/rbot/plugins.rb4
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)