for serverAuditLog := range get_server_audit_logs(Args{server_id: trigger.server_id}) {
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Entry ID: " + serverAuditLog.entry_id,
})
}
LoopServers
Retrieve audit log entries for a server.
Action Type ID is a numeric identifier for the audit log action. Returns up to 100 entries.
- Loop block: the blocks placed inside it run once for each item, and can use the current item's outputs.
Inputs
Server IDRequired
ID of the server to retrieve audit logs from.
Limit
Max entries to retrieve (1-100, default 50).
User ID
Filter by user who performed the action.
Action Type
Filter by action type ID.
Loop Body
Blocks to run for each audit log entry.
Holds blocks
Outputs
Iteration Number
Current iteration (1-based).
Example: 1
Total Iterations
Total number of entries returned.
Example: 50
Entry ID
ID of the audit log entry.
User ID
ID of the user who performed the action.
Target ID
ID of the target entity.
Action Type ID
Numeric audit log action type.
Example: 20
Reason
Reason provided for the action.
Raw JSON
Full raw JSON of the audit log entry.
Build a bot using blocks like Get Server Audit Logs
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.
ID:
get_server_audit_logs- Loop block: write
for item := range get_server_audit_logs(Args{...}) { ... }and read the current item's outputs fromitem. See loops.
Inputs
| Field | InventScript name | Value |
|---|---|---|
| Server ID | server_id | |
| Limit | limit | |
| User ID | user_id | |
| Action Type | action_type | |
| Loop Body | body | blocks: func() { ... } |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Iteration Number | iteration_number | e.g. "1" |
| Total Iterations | total_iterations | e.g. "50" |
| Entry ID | entry_id | |
| User ID | user_id | |
| Target ID | target_id | |
| Action Type ID | action_type_id | e.g. "20" |
| Reason | reason | |
| Raw JSON | raw_json |
Example InventScript
More servers blocks
Get ServerRetrieve a Discord server's information by its ID.Get ServersRetrieve a list of Discord servers the bot is a member of.Get Server Vanity URLRetrieve a server's vanity invite URL.Get Server PermissionsGet the server-wide permissions of a member or role. A member's permissions combine all of their roles. A role's permissions combine that role with @everyone only.Update ServerUpdate a Discord server's information by its ID.Leave ServerLeave a Discord server by its ID.