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,
})
}
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 fromitem. See loops.
Inputs
| Field | InventScript name | Value |
|---|---|---|
| Server ID | server_id | |
| Loop Body | body | blocks: func() { ... } |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Iteration Number | iteration_number | e.g. "1" |
| Total Iterations | total_iterations | e.g. "3" |
| Rule ID | rule_id | |
| Server ID | server_id | |
| Name | name | |
| Creator ID | creator_id | |
| Event Type | event_type | |
| Trigger Type | trigger_type | |
| Enabled | enabled |