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
- Create a DeleteReactionRequest object by using the builder pattern.
- Call the
deleteReaction()
function using the instance ofLMChatClient
, passing therequest
object and an optional response handler. - 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
VARIABLE | TYPE | DESCRIPTION | OPTIONAL |
---|---|---|---|
conversationId | String | ID of the conversation where the reaction is to be deleted | |
messageId | String | ID of the message that contains the reaction | |
reactionId | String | ID of the reaction to be deleted |