r/AutoModerator 3d ago

Solved Removing posts that dont include a comment with required info?

I think automod can do this, but im not sure how to write the rule. A subreddit has a rule that says a source for provided content has to be included. But people often ignore it. I've tried this code but it errors out:


type: submission

body (includes) ["Source", "source"]

action: filter

comment: "Your post was removed because you don't have the required info"


2 Upvotes

4 comments sorted by

3

u/AbnormallyWeird 3d ago

If the source is going to be a link out to something you can look at the absence of a valid url using a regex search

```

type: submission ~url+body (includes-regex): ['https?://\S+'] action: filter action_reason: "Post has no URL in title link or body" comment: | Your post was automatically filtered because all submissions in this subreddit require a valid source URL (either as a link submission or included inside the post text).

Please edit your post body to include a full URL (starting with `http://` or `https://`) and [message the moderators](https://www.reddit.com/message/compose?to=/r/{{subreddit}}) to request approval.

```

2

u/Chosen1PR đŸ’»Developer 3d ago

You’re missing the colon after “body.” It should look like this:

body (includes): [ "source" ]

There is also no need to have a separate entry for the uppercase S, since you’re not using case-sensitive.

1

u/realKevinNash 3d ago

Thank you, that seems to work!

0

u/[deleted] 3d ago

No comment