                   data = JSON.parse part
                   self.emit data.type, data.id, data.created_at, data.room_id, data.user_id, data.body
                 catch err
-                  @robot.logger.error "Campfire error: #{err}"
-
-        response.on "end", =>
-          @robot.logger.error "Streaming connection closed for room #{id}. :("
+                  logger.error "Campfire error: #{err}"
+
+        response.on "end", ->
+          logger.error "Streaming connection closed for room #{id}. :("
           setTimeout (->
             self.emit "reconnect", id
           ), 5000
 
-        response.on "error", (err) =>
-          @robot.logger.error "Campfire response error: #{err}"
+        response.on "error", (err) ->
+          logger.error "Campfire response error: #{err}"
 
       request.on "error", (err) ->
-        @robot.logger.error "Campfire request error: #{err}"
+        logger.error "Campfire request error: #{err}"
 
       request.end()
 

        "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
            @robot.logger.error "Campfire error: #{chunk}"
            process.exit(1)

          else

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

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

