Skip to main content

Get Chatroom Actions

Retrieves the list of available actions for a specific chatroom. These actions include muting, following, viewing participants, and more. The response includes the list of actions that can be performed within the chatroom, participant count, and additional details.

Steps to get chatroom actions

  1. Create a GetChatroomActionsRequest object using the builder pattern.
  2. Call the getChatroomActions() function using the instance of LMChatClient, passing the request object and an optional response handler.
  3. Process the response LMResponse<GetChatroomActionsResponse> to handle the available chatroom actions or any errors.
let request = GetChatroomActionsRequest.builder()
.chatroomId("ENTER_CHATROOM_ID")
.build()

LMChatClient.shared.getChatroomActions(request: request) { response in
if let result = response?.data {
// Handle success
print("Available chatroom actions: \(result.chatroomActions)")
print("Participant count: \(result.participantCount)")
} else if let error = response?.error {
// Handle error
print("Error fetching chatroom actions: \(error.localizedDescription)")
}
}

Models

GetChatroomActionsRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
chatroomIdStringID of the chatroom for which to fetch actions

GetChatroomActionsResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
canAccessSecretChatroomBoolWhether the user can access the secret chatroom
chatroomActionsChatroomActionList of available actions for the chatroom
participantCountIntNumber of participants in the chatroom
placeHolderString?Placeholder text for the chatroom✔️

ChatroomAction

VARIABLETYPEDESCRIPTIONOPTIONAL
idChatRoomActionTypeThe type of action available in the chatroom
titleStringThe title of the action
routeString?The route or path for the action, if applicable✔️

ChatRoomActionType

ACTIONDESCRIPTION
.viewParticipantsView the participants of the chatroom
.inviteInvite others to the chatroom
.followFollow the chatroom
.unFollowUnfollow the chatroom
.muteMute notifications for the chatroom
.unMuteUnmute notifications for the chatroom
.reportReport the chatroom
.leaveChatRoomLeave the chatroom
.blockDMMemberBlock direct messages from a member
.unblockDMMemberUnblock direct messages from a member
.viewProfileView the profile of a chatroom participant

This documentation includes the steps for using the getChatroomActions() function, along with detailed explanations and code examples for the request and response models. Let me know if you need any changes or additional information!