Block Member
LikeMinds React Chat SDK includes a robust Block Member functionality, empowering you to effectively manage your chat environment. With this feature, you can easily block specific members, ensuring a secure and comfortable communication experience
Steps to block member
- To block a member, use the method
blockMember(). - Pass in the required parameters
chatroomIdandstatus. - Process the response as per your requirement.
// To unblock a member, set the status to 1
const payload: any = {
chatroomId: 89899, //your chatroom id
status: 0, // set status to 0 to block
};
const response = await lmChatClient.blockMember(payload);
if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}
Block Member Payload
List of parameters for the blockMember() function.
| Variable | Type | Description | Optional |
|---|---|---|---|
| chatroomId | number | Chatroom Id | |
| status | number | Member Id |
Block Member Response
List of parameters in the response.
| Variable | Type | Description |
|---|---|---|
| success | boolean | API success status |
| error_message | string | Error message in case of failure |