           password: options.password,
           debug: true,
           port: options.port,
+          stripColors: true,
+          floodProtection: true,
         }
 
     unless options.nickpass

        if from is 'NickServ' and text.indexOf('registered') isnt -1
          bot.say 'NickServ', "identify #{options.nickpass}"
        else if options.nickpass and from is 'NickServ' and text.indexOf('now identified') isnt -1
          for room in options.rooms
            bot.join room, ->
              console.log('%s has joined %s', options.nick, room)

    bot.addListener 'message', (from, toRoom, message) ->
      console.log "From #{from} to #{toRoom}: #{message}"

      if message.match new RegExp "^#{options.nick}", "i"
        unless user_id[from]
          user_id[from] = next_id
          next_id = next_id + 1

      user = new Robot.User user_id[from], {
        room: toRoom,
      }

      self.receive new Robot.TextMessage(user, message)


class IrcBot extends Robot
  send: (user, strings...) ->
    for str in strings
      if user.room
        console.log "#{user.room} #{str}"
        @bot.say(user.room, str)
      else
        console.log "#{user.name} #{str}"
        @bot.say(user.name, str)

  reply: (user, strings...) ->
    for str in strings
      @send user, "#{user.name}: #{str}"

  join: (channel) ->
    self = @
    @bot.join channel, () ->
      console.log('joined %s', channel)

  part: (channel) ->
    @bot.part channel, () ->
      console.log('left %s', channel)

  run: ->
    self = @

    options =
      nick:     process.env.HUBOT_IRC_NICK
      port:     process.env.HUBOT_IRC_PORT
