Threativore: An anti-spam automoderator for Lemmy
cross-posted from: lemmy.dbzer0.com/post/15112791
Hey y’all. I’ve been working on this little project ever since the recent spam wave started. This is a very basic Python automoderator bot which will monitor the comments and posts federated into your instance for specific regex instances and then automatically report, delete, ban etc.
The Bot setup is very simple, as you can just chuck its docker-compose entry into your existing lemmy one. You just need to fill in the relevant environment variables.
The bot works by constantly polling your incoming reports, posts and comments, and matching them against provided regex.
I wanted to keep things simple for admins, so the bot configuration happens via a simple PM syntax. The README goes into details on this. But you basically send a message like this to the Bot to add a new filter
<span style="color:#323232;">threativore add comment filter: `trial period` </span><span style="color:#323232;">reason: `Spam comment` </span><span style="color:#323232;">action: `REMOVE` </span><span style="color:#323232;">description: `Known spam string` </span>
All bot controls work the same way. Eventually I want to add a UI to it.
The bot is built with collaboration in mind. So you can add more people to help you maintain your filters (even if they’re not admins), you can add users whose reports will be treated more seriously, and you can even mark users as “ham” (i.e. known not spammers) to prevent them ever being filtered.
This is just the very first release and I have a lot of ideas to improve it in the future. Here’s some stuff in my roadmap which should make the threativore a much more collaborative/crowdsourced process between multiple instance admins and the larger userbase. Stay tuned.
PRs and suggestion are welcome.
PS: The bot is already active on lemmy.dbzer0.com, so you can check the modlog for its actions.
![](https://kbin.life/media/cache/resolve/entry_thumb/f7/b0/f7b0cb40bcc84f3cf3ae5c868d720b7f7784187f4e1950360acd031192db98d7.png)