-
Notifications
You must be signed in to change notification settings - Fork 1
Post
A Post rule prescribes the automated removal of a post, based on its title, its content or the link attached to it.
The structure of the rule remains largely unchanged from the Comment rule, having only one additional field not present in the former: the field
key.
{
"rule": "post",
"community": "memes",
"field": "title",
"type": "exact",
"match": "pizza",
"whitelist_exempt": false,
"mod_exempt": false,
"message": "Your post has been removed because discussions about pizza are prohibited in this community",
"removal_reason": "Said the word 'pizza'"
}
Explanation:
This rule removes all posts containing the word "pizza" in their title, posted in the community c/memes. The bot will then reply to the removed post explaining that it was removed because discussion about pizza are prohibited. Lastly, it will report the removal in the modlog giving "Said the word 'pizza'" as a removal reason. This rule will be valid for all users, including whitelisted users and moderators.
Same as Comment, save for one additional key:
Field Name | Type | Description |
---|---|---|
field |
string, either "title" , "body" , "link" or their combinations
|
Field or fields to be checked by the rule |
Example: the sample rule posted above will remove all posts containing the word "pizza" in their title, but it will NOT remove those containing the word "pizza" in their body, such as a text post saying "I really like pizza" NOR their links, such as attaching the URL "pizza.example.com".
To remove these last two occurrences, the bot will require two additional rules with respectively "field": "body"
and "field": "link"
, or a single rule on multiple fields.
Suppose you wanted to create a rule to remove a post if a keyword was included in either its title, body or link. Instead of having to create multiple rules for separate fields, you can use the shorthand +
operator in the field
, allowing you to combine multiple fields.
The order of the fields isn't important.
{
"rule": "post",
"community": "general",
"field": "body+title+link",
"type": "exact",
"match": "cat",
"whitelist_exempt": false,
"mod_exempt": false,
"message": null,
"removal_reason": null
}
Explanation:
This rule automatically removes all posts containing the word "cat" in either their title, body or link.
Discord link
{
"rule": "post",
"community": "general",
"field": "link",
"type": "exact",
"match": "discord",
"whitelist_exempt": true,
"mod_exempt": true,
"message": "To avoid spam, Discord links are automatically removed",
"removal_reason": "Contained a Discord link"
}
Explanation:
This rule automatically removes all posts whose link contains the word "discord". This means that any post with a https://discord.com
URL will be removed, however posts with the word "discord" in their title or body will NOT be removed. This rule is lifted for whitelisted users and moderators.
Bad word
{
"rule": "post",
"community": "general",
"field": "title+body",
"type": "regex",
"match": "/frick/i",
"whitelist_exempt": false,
"mod_exempt": false,
"message": "Watch your language!",
"removal_reason": null
}
Explanation:
This rule automatically removes all posts containing the word "frick" (case insensitive) in their title or body. It's an example of a rule on multiple fields.
The AutoMod for Lemmy is an open source project published with the GPL-3.0 license by Tommaso Ornato, built for the Based Count Lemmy instance.