diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-04-13 01:44:26 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2008-04-13 01:44:26 +0200 |
commit | 26856c6742be2b79524533e7fd2b9cb3a93faa82 (patch) | |
tree | 5a209f4094a928305f6f3cfa507660286d65d7a3 | |
parent | 5509b8844473382646304fa699048de4551f5773 (diff) |
+ NamesMessage class
-rw-r--r-- | lib/rbot/ircbot.rb | 4 | ||||
-rw-r--r-- | lib/rbot/message.rb | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/rbot/ircbot.rb b/lib/rbot/ircbot.rb index a22d1772..18e9e57c 100644 --- a/lib/rbot/ircbot.rb +++ b/lib/rbot/ircbot.rb @@ -685,7 +685,9 @@ class Bot @plugins.irc_delegate("topic", m) } @client[:names] = proc { |data| - @plugins.delegate "names", data[:channel], data[:users] + m = NamesMessage.new(self, server, server, data[:channel]) + m.users = data[:users] + @plugins.delegate "names", m } @client[:unknown] = proc { |data| #debug "UNKNOWN: #{data[:serverstring]}" diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index 494b6877..b433bee3 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -472,6 +472,15 @@ module Irc end end + # class to manage NAME replies + class NamesMessage < BasicUserMessage + attr_accessor :users + def initialize(bot, server, source, target, message="") + super(bot, server, source, target, message) + @users = [] + end + end + class QuitMessage < BasicUserMessage def initialize(bot, server, source, target, message="") super(bot, server, source, target, message) |