Skip to main content

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

  1. Create a SetChatroomTopicRequest object using the builder pattern.
  2. Call the setChatroomTopic() function using the instance of LMChatClient, passing the request object and an optional response handler.
  3. 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

VARIABLETYPEDESCRIPTIONOPTIONAL
chatroomIdStringID of the chatroom for which the topic is being set
conversationIdStringID of the conversation to set as the chatroom topic