Motivtion, keywords and hashtags
Example DM notifying about an autosuspension
This bot originally started as an attempt to detect the usage of slurs, with a few spam hashtags thrown in. It turned out to not be effective and the only hits I got for slurs so far were people self-describing. So, looks like my server blocks are taking care of common slurs well enough for now.
Another thing to watch out for is that a slur might not be a slur in another language, e.g. "retard" is the French word for "delay". So, I added the capability to restrict a keyword to a given language list. Note that people often do not set their language correctly though, and that not all Fediverse software allows choosing a posting language.
I turned to a different issue next: My server is open to all ages, but there are servers that allow content aimed at an adult audience, and their posts can reach my federated timeline. So, I decided to make the bot more powerful and support rulesets for groups of keywords that can trigger automated moderation actions that will also notify me via DM so that I can review the actions taken, and create an audit trail via reports. The DM also comes with convenient links to access the profile, the moderation page and the first few posts found.
For adult content, there's also the option to trigger the keywords only if the post is not marked as sensitive, in case your sever allows it and you want to check that CWs have been applied.
For designing your hashtag and keyword lists, the "keywords" list should contain only very specific terms, while the "hashtag" list can be just a little bit broader.