     else
       request.end()
 
-    request.on "error", (err) =>
-      @robot.logger.error "Campfire request error: #{err}"
-
+    request.on "error", (err) ->
+      logger.error "Campfire request error: #{err}"
+

          bot.Room(roomId).join (err, callback) ->
            bot.Room(roomId).listen()

    bot.on "reconnect", (roomId) =>
      bot.Room(roomId).join (err, callback) ->
        bot.Room(roomId).listen()


        "method" : "GET"
        "headers": headers

      request = HTTPS.request options, (response) ->
        response.setEncoding("utf8")

        buf = ''

        response.on "data", (chunk) ->
          if chunk is ' '
            # campfire api sends a ' ' heartbeat every 3s

          else if chunk.match(/^\s*Access Denied/)
            # errors are not json formatted
            logger.error "Campfire error: #{chunk}"
            process.exit(1)

          else
