Get AutoMod Rules

LoopAuto Moderation

List all auto moderation rules for a server.

  • Loop block: the blocks placed inside it run once for each item, and can use the current item's outputs.

Inputs

Server IDRequired

Server to list rules for.

Loop Body

Blocks to run for each rule.

Holds blocks

Outputs

Iteration Number

Current iteration (1-based).

Example: 1

Total Iterations

Total number of iterations.

Example: 3

Rule ID

ID of the auto moderation rule.

Server ID

ID of the server.

Name

Name of the rule.

Creator ID

User who created the rule.

Event Type

Event type (Message Send or Member Update).

Trigger Type

Trigger type (Keyword, Spam, Keyword Preset, Mention Spam, Member Profile).

Enabled

Whether the rule is enabled.

Build a bot using blocks like Get AutoMod Rules

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: get_automod_rules
  • Loop block: write for item := range get_automod_rules(Args{...}) { ... } and read the current item's outputs from item. See loops.

Inputs

FieldInventScript nameValue
Server IDserver_id
Loop Bodybodyblocks: func() { ... }

Outputs

FieldInventScript nameValue
Iteration Numberiteration_numbere.g. "1"
Total Iterationstotal_iterationse.g. "3"
Rule IDrule_id
Server IDserver_id
Namename
Creator IDcreator_id
Event Typeevent_type
Trigger Typetrigger_type
Enabledenabled

Example InventScript

for automodRule := range get_automod_rules(Args{server_id: trigger.server_id}) {
	send_text_message(Args{
		channel_id:      trigger.channel_id,
		message_content: "Rule ID: " + automodRule.rule_id,
	})
}

More auto moderation blocks