lib/bot.rb
def assign_bot_callback_procs(bot)
      bot.on_message do |time,nick,message|
        match = @bot_reg_exp.match(message)
        if match
          @responders.receive(match[1]).each {|reply| bot.say(reply) }
        end
      end

      bot.on_private_message do |time,nick,message|
        responder.receive(message).each {|reply| bot.say(reply,nick) }
      end
    end
# Attaches callbacks to chat client, directing messages to a ResponderGroup / Responder.
Attaches callbacks to chat client, directing messages to a ResponderGroup / Responder.
Attaches callbacks to chat client directing messages to a ResponderGroup / Responder .
def assign_bot_callback_procs(bot)
      bot.on_message do |time,nick,message|
        match = @bot_reg_exp.match(message)
        if match
          @responders.receive(match[1]).each {|reply| bot.say(reply) }
        end
      end
      bot.on_private_message do |time,nick,message|
        responder.receive(message).each {|reply| bot.say(reply,nick) }
      end
    end
def assign_bot_callback_procs ( bot ) bot . on_message do | time , nick , message | match = @bot_reg_exp . match ( message ) if match @responders . receive ( match [ 1 ] ) . each { | reply | bot . say ( reply ) } end end bot . on_private_message do | time , nick , message | responder . receive ( message ) . each { | reply | bot . say ( reply , nick ) } end end
Attaches callbacks to chat client, directing messages to a ResponderGroup / Responder.
Attaches callbacks to chat client directing messages to a ResponderGroup / Responder .
bot