 WebSocket = require "ws"
 
 class QuipTextMessage extends TextMessage
-  constructor: (@user, @quipMessage) ->
-    super @user, @quipMessage.text, @quipMessage.id
+  constructor: (@user, @text, @quipMessage) ->
+    super @user, @text, @quipMessage.id
 
 class QuipHubot extends Adapter
   constructor: (robot) ->

        if @robot.name.indexOf(packet.user.id) != -1
          return
        user = @robot.brain.userForId packet.user.id, name: @.quipMention(packet.user.id), room: packet.thread.id
        message = new QuipTextMessage user, packet.message
        @robot.receive message
      else
        @robot.logger.info "Got %s", packet.type

        @robot.logger.error "Giving up"
    else
      @socketUrl = response.url
      @selfMention = @.quipMention(response.user_id)
      @connect()

  quipMention: (userId) ->
