-
Notifications
You must be signed in to change notification settings - Fork 0
Setting up AutoMod
In order to set up AutoMod in your guild you need to invite @AutoJannie as a GuildMaster
Once you have done that you can go ahead and write a config
- Config must be a post named
wizard.config - Configs can only be posted by the Guildmaster of a guild.
- Configs are writen in YAML. It's a good idea to check if your config's syntax is correct
- Rules must be separated by a line starting with exactly 3 hyphens:
--- - You must define a
typefor each rule
AutoMod rule must consist of type (also called a trigger - it's what activates the AutoMod), one or more checks (conditions that the comment or submission must meet) and one or more actions (things that will be performed on any posts that meet the conditions). Both checks and actions are defined by writing a line that has the name of the check or the action, followed by a colon, and then the value to set it to. For example, the line to define the action of kicking a post looks like this:
action: kick
This sets the value of action for that rule to kick. A rule is made up by defining all of its checks and actions separately just like this. For example, here is a basic rule to kick any text submissions that have the word "disallowed" in their title.
type: text
title: disallowed
action: kick
That's it. All AutoModerator rules are simply a combination of checks and actions, but some very complex rules can be built up from these pieces.
In general, if you define multiple different checks on a rule, all of them must be satisfied in order to cause the actions to be performed. For example, here is a similar rule with two separate checks:
type: link
title: disallowed
domain: youtube.com
action: kick
Now a link submission with "disallowed" in its title will only be kicked if it is also a link to YouTube. If it has "disallowed" in the title but goes to any other domain at all, it will not be kicked because both of the conditions were not satisfied. If you want to kick submissions with title "disallowed" or link to youtube, you can either make two separate rules or make use of or & and operators. Here's an example:
type: link
or:
title: disallowed
domain: youtube
action: kick
Now, remember or is just a config, so it needs to be true in order for the entire rule to be true. or config is true when any of the configs inside of it are also true. You can do simmilar configs with and config.
Checking for any item from a list of possibilities Of course, most rules do not apply to only a single word or domain. It is very common to write rules similar to "if the title contains any of these words...", so AutoModerator includes a way to define a list of possibilities, where the rule will be applied if any of the possibilities are found. Here's an example rule that will kick any posts with swear words in their body:
title: [list, of swear, words]
action: kick
To define a list of items, surround the entire list with square brackets, and separate items with commas.
Reverse checks / "must not match"
Sometimes it is useful to be able to do a "reverse check", where instead of looking for the presence of something in particular, you want to check whether something is NOT present. For example, if a guild required every submission to be from YouTube, they would want a rule to remove any submission that is from any other domain. A check is reversed by putting a tilde ~ in front of it, so the rule for a YouTube-only guild would be something like:
~domain: [youtube.com, youtu.be]
action: kick
Author checks In addition to checking for conditions to be satisfied by comments or submissions themselves, you can also set conditions on the author of them. You can check things like author rep, or account age:
type: text
author:
account_age: < 1 day
message: |
Hey @{{author}} welcome to +{{guild}}!
Notice that the account_age: setting is indented further than author: is. This is because the account_age check must be done "inside" the author check. For more information about what is possible with author checks, please see the section of the official documentation listing the other available ones.