# Get AutoMod Rules

> List all auto moderation rules for a server.

- ID: `get_automod_rules`
- Type: Loop
- Category: [Auto Moderation](https://inventor.bot/docs/reference/blocks/auto-moderation.md)

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

**Inputs**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `server_id` | yes | Server to list rules for. |  |
| `body` |  | Blocks to run for each rule. | blocks: `func() { ... }` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `iteration_number` | Current iteration (1-based). | e.g. `"1"` |
| `total_iterations` | Total number of iterations. | e.g. `"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. |  |

**Example**

```go
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,
	})
}
```