Skip to main content

Leave Chatroom

Leaving a chatroom with LikeMind React Chat SDK allows you to exit a chatroom that you no longer want to be a part of.

Steps to leave an Open ChatRoom​

  1. To leave a chatroom, use the method followChatroom().
  2. Pass in the required parameters collabcardId, memberId and value.
  3. Process the response as per your requirement.
// To leave a chatroom, set the value to false
const payload: any = {
collabcardId: 89899, //your chatroom id
value: false,
memberId: 23233, // member id
};
const response = await lmChatClient.followChatroom(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Leave Chatroom Payload​

List of parameters for the followChatroom() method.

VariableTypeDescriptionOptional
collabcardIdnumberChatroom Id
memberIdnumberMember Id
valuebooleanFollow value

Leave Chatroom Response​

List of parameters in the response.

VariableTypeDescription
successbooleanAPI success status
error_messageStringError message in case of failure

Steps to Leave a Secret Chatroom.​

  1. To leave a secret chatroom use the method leaveSecretChatroom().
  2. pass in the required parameter chatroomId and isSecret.
  3. Process the response as per your requirement.
const payload: any = {
chatroomId: 89899, // Your chatroom ID.
isSecret: true,
};
const response = await lmChatClient.leaveSecretChatroom(payload);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Leave Secret Chatroom Payload​

List of parameters for the function leaveSecretChatroom.

VariableTypeDescriptionOptional
chatroomIdnumberChatroom Id
isSecretbooleanSet to true in case of secret chatroom

Leave Secret Chatroom Response​

List of parameters for the response.

VariableTypeDescription
successbooleanAPI success status
error_messagestringError message in case of failure