Skip to main content

Delete Reaction

Deletes a reaction on a message or conversation based on the specified request. This function handles the removal of a user’s reaction and provides a response indicating success or failure.

Steps to delete a reaction

  1. Create a DeleteReactionRequest object by using the builder pattern.
  2. Call the deleteReaction() function using the instance of LMChatClient, passing the request object and an optional response handler.
  3. Process the response LMResponse<NoData> to handle the result of the deletion.
let request = DeleteReactionRequest.builder()
.conversationId("ENTER_CONVERSATION_ID")
.messageId("ENTER_MESSAGE_ID")
.reactionId("ENTER_REACTION_ID")
.build()

LMChatClient.shared.deleteReaction(request: request) { response in
if response?.error == nil {
// Handle success
print("Reaction deleted successfully.")
} else {
// Handle error
print("Error deleting reaction: \(response?.error?.localizedDescription ?? "Unknown error")")
}
}

Models

DeleteReactionRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
conversationIdStringID of the conversation where the reaction is to be deleted
messageIdStringID of the message that contains the reaction
reactionIdStringID of the reaction to be deleted