Comment on Discussion: Long-term need for automation tools for moderation
asudox@lemmy.asudox.dev 17 hours agoWell, my initial idea was to build this only for lemmy.
However, the API was not good enough for my use case. Polling new posts and comments was my main issue with it. So mostly scaling issues. You could miss some posts and comments and the amount of API requests will get bigger with the amount of communities the bot will moderate. There are also some problems with rate limiting.
They can be solved by directly querying the database, but who’s going to give you database access? So you’d have to selfhost lemmy yourself just for the bot. And I’d imagine the database would grow pretty fast with the number of communities. I explicitly do not want to store any posts or comments. And even then, maintaining the required SQL query for Lemmy posts is the last thing I want to do.
Another solution would be using Lemmy’s new webhook system, but I don’t know how reliable it will be.
So I stopped halfway through and started a new project with new goals:
- Make a new federated platform
With federation, the problems above would be solved. This also allows it to be hosted without having to find an instance for it or even self host it yourself.
- Stronger integration with platforms via a modular federation system
If I made it depend on Lemmy, a strong integration with other platforms wouldn’t be possible. Piefed has features that Lemmy doesn’t, for example. People can maintain a set of platform specific activitypu bstructs and enable the bot to federate with that platform.
Not really answering your question, but I’d like to make a clarification: The bots will only be able to operate within the community (or I guess group) boundaries. They cannot manage any instances. Furthermore, my main intention is for them to be used primarily as moderation bots, but they can also be used as general purpose bots within the community.
nutomic@lemmy.ml 36 minutes ago
To get new posts and comments for all known communities you only need to make regular requests to
/api/v3/post/list?limit=50&sort=New&type_=All
and/api/v3/comment/list?limit=50&sort=New&type_=All
. Its not necessary to make separate requests for each community. The default rate limit allows 180 read requests per minute so you can comfortably poll this every second (in practice every 30s or so should be enough). If you miss an item (ie post or comment id was skipped) just load the following page.The plugin system in 1.0 would be another option. It will still take some time until that is released, but there shouldnt be any reliability issues.
Youre right that federation solves these problems, but instead you get another problem of writing all this federation code and making sure it is compatible with different platforms. Lemmy’s federation code has around 12k lines so that is a lot. It seems much simpler to use the API for Lemmy, Piefed etc and write abstractions for common functionality.
Anyway this is my opinion. Its your project so in the end its your decision how to implement it.