text: const http = require('../util/http.js').func
  const getGeneralToken = require('../util/getGeneralToken.js').func
  
  exports.required = ['conversationId', 'userId']
  exports.optional = ['jar']
  
  const nextFunction = (jar, token, conversationId, userId) => {
    return http({
      url: '//chat.roblox.com/v2/remove-from-conversation',
      options: {
        method: 'POST',
        jar: jar,
        headers: {
          'X-CSRF-TOKEN': token
        },
        json: {
          conversationId: conversationId,
          participantUserId: userId
        },
        resolveWithFullResponse: true
      }
    }).then((res) => {
      if (res.statusCode === 200) {
        if (!res.body.resultType === 'Success') {
          throw new Error(res.body.statusMessage)
        }
      } else {
        throw new Error('Remove from group chat failed')
      }
    })
  }
  
  exports.func = (args) => {
    const jar = args.jar
  
    return getGeneralToken({ jar: jar }).then((xcsrf) => {
      return nextFunction(jar, xcsrf, args.conversationId, args.userId)
    })
  }
  