@registry[:wordcache] = @wordcache
end
- def listen(m)
- return unless m.kind_of?(PrivMessage)
+ def message(m)
return if m.channel.nil? or m.address?
k = m.channel.downcase.to_s # to_sym?
return unless @games.key?(k)
# Reimplemented from Plugin
#
- def listen( m )
- return unless m.kind_of?(PrivMessage)
-
+ def message(m)
chan = m.channel
return unless @quizzes.has_key?( chan )
q = @quizzes[chan]
end
# all messages from a channel is sent to its shiritori game if any
- def listen(m)
- return unless m.kind_of?(PrivMessage)
+ def message(m)
return unless @games.has_key?(m.channel)
# send the message to the game in the channel to handle it
@games[m.channel].handle_message m
end
end
- def listen(m)
- return unless m.kind_of?(PrivMessage) and not m.address?
+ def message(m)
+ return if m.address?
ch = m.channel.irc_downcase(m.server.casemap).intern
return unless game = @games[ch]
return unless game.running?
"karma module: Listens to everyone's chat. <thing>++/<thing>-- => increase/decrease karma for <thing>, karma for <thing>? => show karma for <thing>, karmastats => show stats. Karma is a community rating system - only in-channel messages can affect karma and you cannot adjust your own."
end
- def listen(m)
- return unless m.kind_of?(PrivMessage) && m.public? && m.message.match(/\+\+|--/)
+ def message(m)
+ return unless m.public? && m.message.match(/\+\+|--/)
arg = nil
op = nil
ac = Hash.new
end
# Main method
- def listen(m)
+ def message(m)
linkbots = @bot.config['linkbot.nicks']
return if linkbots.empty?
return unless linkbots.include?(m.sourcenick)
- return unless m.kind_of?(PrivMessage)
# Now we know that _m_ is a PRIVMSG from a linkbot. Let's split it
# in nick, network, message
if @message_patterns.any? {|p| m.message =~ p}
end
end
- def listen(m)
- return unless m.kind_of?(PrivMessage) && m.public?
+ def message(m)
+ return unless m.public?
return if m.address?
return if ignore? m.source
end
end
- def listen(m)
- return unless(m.kind_of? PrivMessage)
-
+ def message(m)
command = m.message.dup
if(m.address? && m.private?)
case command
Thread.new { handle_urls(m, urls, params[:urls].length) }
end
- def listen(m)
- return unless m.kind_of?(PrivMessage)
+ def message(m)
return if m.address?
escaped = URI.escape(m.message, OUR_UNSAFE)