Secret Chatroom Invite
LikeMinds React Chat SDK offers a convenient feature for sending secret chatroom invites. It allows you to send invites to a specific user within a group chat.
Steps to send Secret Chatroom Invite to a participant
- Get the list of participants using
getAllMembers()method. - Send Invite to selected members using
sendInvites()method. - Pass in the required parameters
chatroomId,isSecretandchatroomParticipants. - Process the response as per your requirement.
const payload: any = {
chatroomId: 89899, // Id of the chatroom
isSecret: true, // false if chatroom is open
chatroomParticipants: [], // list of memberId's of selected members
};
const response = await lmChatClient.sendInvites(payload);
if (response.success) {
// your function to process the response data
processResponse();
} else {
// your function to process error message
processError(response);
}
Secret Chatroom Invite Payload
List of parameters for the sendInvites function.
| Variable | Type | Description | Optional |
|---|---|---|---|
| chatroomId | number | Chatroom Id | |
| isSecret | boolean | true if chatroom is secret | |
| chatroomParticipants | array | List of participants |
Secret Chatroom Invite Response
List of parameters in the response.
| Variable | Type | Description |
|---|---|---|
| success | boolean | API success status |
| error_message | string | Error message in case of failure |