 
     @robot.logger.info "Fetching websocket URL..."
     @client = new Quip.Client options
-    @client.getWebsocket(@.websocketUrl)
+    @client.getWebsocket @websocketUrl
 
   websocketUrl: (error, response) =>
     if error

    attachments = []
    for msg in strings
      period = msg.lastIndexOf(".")
      if @.isImageUrl(msg)
        attachments.push(msg)
      else
        text.push(msg)
    return unless text.length or attachments.length
    options = {"threadId": envelope.room, "serviceId": envelope.message.id}
    if attachments.length
      options.attachments = attachments.join(",")
    if text.length
        options.content = text.join("\n\n")
    if envelope.message.quipMessage.annotation
        options.annotationId = envelope.message.quipMessage.annotation.id
    @robot.logger.info "Sending to #{envelope.room}: #{JSON.stringify(options)}"
    @client.newMessage options, @.messageSent

  isImageUrl: (url) ->
    return false unless url.substring(0, 4) == "http"

    if @heartbeatTimeout
      clearInterval @heartbeatTimeout
      @heartbeatTimeout = null
    @ws.close
    @connected = false
    setTimeout =>
      @connect
    , 5000

  websocketMessage: (packet) ->
