   close: =>
     @emit "close", @
 
-  error: (error) =>
+  error: (error) ->
     console.log "Received error #{JSON.stringify error}"
     console.log error.stack
     console.log "Exiting in 1 second"

    @client.on 'error', @.error
    @client.on 'message', @.message
    @client.on 'loggedIn', @.login
    @client.on 'userChange', @.userChange

    @client.login()


  message: (msg) =>
    @emit "message", @, msg

# Export class for unit tests
module.exports = SlackConnection
