Files
context-mod/docs/examples/author
FoxxMD 85b1d13718 docs: Refactor docs to use runs syntax
* Add Runs to main docs readme and concepts
* Add high level diagram in main docs readme to show CM lifecycle
* Refactor subreddit/rule examples to use runs syntax
2022-03-07 10:28:48 -05:00
..

Author

Rule

The Author rule triggers if any AuthorCriteria from a list are either included or excluded, depending on which property you put them in.

AuthorCriteria that can be checked:

  • name (u/userName)
  • author's subreddit flair text
  • author's subreddit flair css
  • author's subreddit mod status
  • Toolbox User Notes

The Author Rule is best used in conjunction with other Rules to short-circuit a Check based on who the Author is. It is easier to use a Rule to do this then to write author filters for every Rule (and makes Rules more re-useable).

Consult the schema for a complete reference of the rule's properties.

Examples

  • Basic examples
    • Flair new user Submission YAML | JSON - If the Author does not have the vet flair then flair the Submission with New User
    • Flair vetted user Submission YAML | JSON - If the Author does have the vet flair then flair the Submission with Vetted
  • Used with other Rules
    • Ignore vetted user YAML | JSON - Short-circuit the Check if the Author has the vet flair

Filter

All Rules and Checks have an optional authorIs property that takes an AuthorOptions object.

This property works the same as the Author Rule except that:

  • On Rules if all criteria fail the Rule is skipped.
    • If a Rule is skipped it does not fail or pass and so does not affect the outcome of the Check.
    • However, if all Rules on a Check are skipped the Check will fail.
  • On Checks if all criteria fail the Check fails.

Examples

  • Skip recent activity check based on author YAML | JSON - Skip a Recent Activity check for a set of subreddits if the Author of the Submission has any set of flairs.