{{define "automod_index"}} {{template "cp_head" .}} {{template "cp_alerts" .}}
{{if .CurrentRuleset}}

Ruleset settings

{{checkbox "Enabled" "automod-rs-enable" `Enable ruleset?` .CurrentRuleset.Enabled}}

Can also be toggled on/off using the automod toggle {{.CurrentRuleset.Name}} command.


Ruleset scoped conditions {{$dot := .}} {{range $i, $jv := .CurrentRuleset.R.RulesetAutomodRulesetConditions}}{{if eq .Kind 1}} {{$settings := index $dot.RSPartData $i}} {{$partType := index $dot.PartMap .TypeID}} {{mTemplate "automod_rule_part_row" "dot" $dot "partIndex" $i "settings" $settings "partType" $partType "part" . "kind" "condition"}} {{end}}{{end}}
Type Options -

Create a new rule

{{else if not .InLogs}}

Automoderator (v2) is a completely new automoderator system made with the goal to be the most flexible, configurable system you could get for a chat bot (within reason).
You start by creating a ruleset, then creating rules inside said ruleset.
Rules consist of one or more triggers, conditions, and effects, you can also apply general conditions on the ruleset itself.
Visit the documentation for more information on how to build rules and some examples.

If you have some suggestions for triggers, conditions, or effects then either open a issue on GitHub or join the support server (link located above).

Create a new ruleset

Rulesets contain rules that you define afterwards

Create a new list

Lists are used for word/website blacklisting/whitelisting

{{else}}
{{$dot := .}} {{range .AutomodLogEntries}} {{end}}
Date (utc) User (id) Ruleset Rule Trigger
{{.CreatedAt.Format "2006 Jan 02 15:04"}} {{.UserName}} {{.UserID}} {{.RulesetName}} {{.RuleName}} {{(index $dot.PartMap (.TriggerTypeid)).Name}}
{{end}}
{{$dot := .}} {{if .CurrentRuleset}} {{range $i, $rule := .CurrentRuleset.R.RulesetAutomodRules}}
{{end}} {{else if not .InLogs}} {{range .AutomodLists}}
{{end}} {{end}} {{template "cp_footer" .}} {{end}} {{define "automod_rule_part_row"}} {{$namePrefix := "Triggers"}} {{if eq .kind "condition"}} {{$namePrefix = "Conditions"}} {{else if eq .kind "effect"}} {{$namePrefix = "Effects"}} {{end}}
{{if .partType.Description}}{{end}}
{{$dot := .}} {{range .partType.UserSettings}}
{{$name := joinStr "" $namePrefix "." $dot.partIndex ".Data." .Key}} {{if eq .Kind "int"}} {{else if eq .Kind "multi_role"}} {{else if eq .Kind "role"}} {{else if eq .Kind "multi_channel"}} {{else if eq .Kind "multi_channel_cat"}} {{else if eq .Kind "string"}} {{else if eq .Kind "list"}} {{else if eq .Kind "bool"}}
{{end}}
{{end}}
{{end}}