Skip to main content

Add Reaction

Reactions are used to add context to a message, such as by indicating that the user agree or disagree with something that was said. You can integrate reactions to react to chat messages and enable your users to react to these messages by following the given steps

Steps to Add Reaction in a Conversation

  1. Create an object of the PutReactionRequest class using the PutReactionRequestBuilder class.
  2. Call putReaction() present in the LMChatClient class using your request object.
  3. Process the response LMResponse<void> as per your requirement.
PutReactionRequest request = (PutReactionRequestBuilder()
..conversationId("ENTER_CONVERSATION_ID")
..reaction("ENTER_REACTION"))
.build();

LMResponse<void> response = await lmChatClient.putReaction(request);

if (response.success) {
// your function to process the response data
processResponse(response);
} else {
// your function to process error message
processError(response);
}

Models

PutReactionRequest

List of parameters for the PutReactionRequest class

VariableTypeDescriptionOptional
conversationIdintConversation ID
reactionStringReaction