We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to remove a comment I'm using
botActions.removeComment({ reason: "Requested by user " + userName, removed: true, comment_id: parentId });
with parentId defined, but it prints Removing comment ID undefined and does not remove the comment.
parentId
Removing comment ID undefined
The text was updated successfully, but these errors were encountered:
What is parentId in this case? I tried to reproduce what it appears you're doing with the following code:
import { CommentView, LemmyBot, PostView } from "lemmy-bot"; const bot = new LemmyBot({ instance: "localhost:8536", credentials: { username: "muhbot", password: "lemmylemmy" }, handlers: { comment: async ({ botActions, commentView }) => { if (commentView.comment.content.includes("remove")) { const parent = await botActions.getParentOfComment(commentView.comment); if (parent.type === "comment") { await botActions.removeComment({ comment_id: (parent.data as CommentView).comment.id, reason: `Requested by ${commentView.creator.name}`, }); } else { await botActions.removePost({ post_id: (parent.data as PostView).post.id, reason: `Requested by ${commentView.creator.name}`, }); } } }, }, }); bot.start();
The bot removed posts and comments as expected. If you could make a minimal reproducible example of your issue, that would be very helpful.
Sorry, something went wrong.
@tubbadu This is from several versions of both this library and lemmy's api ago. Do you still run into the issue?
No branches or pull requests
to remove a comment I'm using
with
parentId
defined, but it printsRemoving comment ID undefined
and does not remove the comment.The text was updated successfully, but these errors were encountered: