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,
})
}
Get Server Audit Logs
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. View as Markdown
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 |