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
- Create a GetChatroomActionsRequest object using the builder pattern.
- Call the
getChatroomActions()
function using the instance ofLMChatClient
, passing therequest
object and an optional response handler. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
chatroomId | String | ID of the chatroom for which to fetch actions |
GetChatroomActionsResponse
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
canAccessSecretChatroom | Bool | Whether the user can access the secret chatroom | |
chatroomActions | ChatroomAction | List of available actions for the chatroom | |
participantCount | Int | Number of participants in the chatroom | |
placeHolder | String? | Placeholder text for the chatroom | ✔️ |
ChatroomAction
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
id | ChatRoomActionType | The type of action available in the chatroom | |
title | String | The title of the action | |
route | String? | The route or path for the action, if applicable | ✔️ |
ChatRoomActionType
ACTION | DESCRIPTION |
---|---|
.viewParticipants | View the participants of the chatroom |
.invite | Invite others to the chatroom |
.follow | Follow the chatroom |
.unFollow | Unfollow the chatroom |
.mute | Mute notifications for the chatroom |
.unMute | Unmute notifications for the chatroom |
.report | Report the chatroom |
.leaveChatRoom | Leave the chatroom |
.blockDMMember | Block direct messages from a member |
.unblockDMMember | Unblock direct messages from a member |
.viewProfile | View 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!