Comments (2)
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.
from lemmy-bot.
@tubbadu This is from several versions of both this library and lemmy's api ago. Do you still run into the issue?
from lemmy-bot.
Related Issues (20)
- Program stops after some time with ETIMEDOUT error. HOT 12
- getUserId and getCommunityId dont always find the user/community HOT 2
- Add a dryrun mode for development
- How to identify if a person is a mod in the community? HOT 2
- Spam of logging in and other stuff HOT 3
- 0.18.1-rc.4 Is broke the bot totally HOT 10
- Invalid JSON response body when starting up HOT 7
- Bot creates a 502 Error
- Getting `user_already_exists` error after login HOT 6
- No editComment or editPost Bot Action? HOT 10
- First fetch works second not anymore HOT 6
- BotAction to follow a community
- Support for the resolveObject method as a BotAction HOT 1
- SQLITE_BUSY: database is locked HOT 5
- Detect if Post URL / Image / Title / Body changed? HOT 3
- Possible spam of (almost) useless console.log HOT 2
- Get Community (and Instance) Info/Sidebar HOT 1
- just sits at "user_already_exists"
- [Feature request] Optional flag to disable logs HOT 2
- How to list user posts & comments ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lemmy-bot.