@plugins.delegate("kick", m)
}
@client[:invite] = proc {|data|
- if data[:target] == myself
- join data[:channel] if @auth.allow?("join", data[:source], data[:source].nick)
- end
+ m = InviteMessage.new(self, server, data[:source], data[:target], data[:channel])
+
+ @plugins.delegate("listen", m)
+ @plugins.delegate("invite", m)
}
@client[:changetopic] = proc {|data|
m = TopicMessage.new(self, server, data[:source], data[:channel], data[:topic])
end
end
+ # class to manage IRC INVITEs
+ # +address?+ can be used as a shortcut to see if the bot was invited,
+ # which should be true except for server bugs
+ class InviteMessage < BasicUserMessage
+ # channel user was invited to
+ attr_reader :channel
+
+ def initialize(bot, server, source, target, channel, message="")
+ super(bot, server, source, target, message)
+ @channel = channel
+ end
+ end
+
# class to pass IRC Nick changes in. @message contains the old nickame,
# @sourcenick contains the new one.
class NickMessage < BasicUserMessage
Called when a user (or the bot) is kicked from a
channel the bot is in.
+ invite(InviteMessage)::
+ Called when the bot is invited to a channel.
+
join(JoinMessage)::
Called when a user (or the bot) joins a channel