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
- Create an instance of
AddCommentReplyRequest
with the required parameters:text
,postId
, andcommentId
. - Call the
addCommentReply()
function using the instance of theLMFeedClient
class, passing the request as a parameter. - 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
Variable | Type | Description |
---|---|---|
text | String | Reply text |
postId | String | Post ID associated with the comment |
commentId | String | Parent comment ID for the reply |
AddCommentReplyResponse
List of parameters for the AddCommentReplyResponse
class
Variable | Type | Description | Optional |
---|---|---|---|
success | bool | API success status | |
errorMessage | String | Error message in failure | ✔ |
reply | Comment | Added comment reply entity | ✔ |