Skip to main content

Reply Comment

The addCommentReply() function facilitates the addition of a reply to a specific comment, extending the conversational aspect of the application. By using this function, developers can empower users to engage in threaded discussions, responding directly to comments within a post.

Steps to Add Comment Reply

  1. Create an instance of AddCommentReplyRequest with the required parameters: text, postId, and commentId.
  2. Call the addCommentReply() function using the instance of the LMFeedClient class, passing the request as a parameter.
  3. Leverage the response as per your application's requirements.
// Create an instance of AddCommentReplyRequest
AddCommentReplyRequest request = (AddCommentReplyRequestBuilder()
..commentId("comment_id")
..text("reply_text")
..postId("post_id"))
.build();

// Get the response from calling the function
final AddCommentReplyResponse replyResponse = await lmFeedClient.addCommentReply(replyRequest);

// Process the response, as per requirement
if (replyResponse.success) {
// your function to handle successful addition of comment reply
handleAddCommentReplySuccess(replyResponse.reply);
} else {
// your function to handle error message
handleAddCommentReplyError(replyResponse.errorMessage);
}

Models

AddCommentReplyRequest

List of parameters for the AddCommentReplyRequest class

VariableTypeDescription
textStringReply text
postIdStringPost ID associated with the comment
commentIdStringParent comment ID for the reply

AddCommentReplyResponse

List of parameters for the AddCommentReplyResponse class

VariableTypeDescriptionOptional
successboolAPI success status
errorMessageStringError message in failure
replyCommentAdded comment reply entity