Block Member
The blockMember()
method is used to block a member from a specific chatroom. You can pass the required parameters such as the chatroomId
and the status
(which represents the block status).
Steps to Block a Member
- Create a
BlockMemberRequest
object with the required parameters such aschatroomId
andstatus
. - Call the
blockMember()
function using the instance of theLMChatClient
class. - Use the response LMResponse<
BlockMemberResponse
> to fetch details about the conversation after blocking the member.
BlockMemberRequest request = (BlockMemberRequestBuilder()
..chatroomId("ENTER_CHATROOM_ID") // Provide the chatroom ID
..status(1)) // Provide the status to block (1 or another value for unblocking)
.build();
final LMResponse<BlockMemberResponse> response = await lmChatClient.blockMember(request);
if (response.success) {
// Use the returned conversation details
handleConversation(response.data.conversation);
} else {
// Handle error
handleError(response);
}
Models
BlockMemberRequest
List of parameters for the BlockMemberRequest
class:
Variable | Type | Description | Optional |
---|---|---|---|
chatroomId | int | The ID of the chatroom where the member will be blocked or unblocked | |
status | int | The block status - 0 to Block Member - 1 to Unblock Member |
BlockMemberResponse
List of parameters for the BlockMemberResponse
class:
Variable | Type | Description | Optional |
---|---|---|---|
conversation | Conversation | The updated conversation after blocking the member | ✔️ |