Set Chatroom Topic
Sets a new conversation as the topic for a specified chatroom. This function allows users to assign a specific conversation as the main topic for the chatroom.
Steps to set a chatroom topic
- Create a SetChatroomTopicRequest object using the builder pattern.
- Call the
setChatroomTopic()
function using the instance ofLMChatClient
, passing therequest
object and an optional response handler. - Process the response LMResponse<NoData> to handle the success or any errors.
let request = SetChatroomTopicRequest.builder()
.chatroomId("ENTER_CHATROOM_ID")
.conversationId("ENTER_CONVERSATION_ID")
.build()
LMChatClient.shared.setChatroomTopic(request: request) { response in
if response?.error == nil {
// Handle success
print("Chatroom topic set successfully.")
} else {
// Handle error
print("Error setting chatroom topic: \(response?.error?.localizedDescription ?? "Unknown error")")
}
}
Models
SetChatroomTopicRequest
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
chatroomId | String | ID of the chatroom for which the topic is being set | |
conversationId | String | ID of the conversation to set as the chatroom topic |