docsTriggersEventsonAuditLogEntry

onAuditLogEntry

Fires when an audit log entry is created in a guild. Requires the GUILD_MODERATION intent. Entry fields are read with Zoption{key}.

When it fires

Any auditable action occurs

Available Context Variables

VariableDescription
author_idUser ID of whoever performed the action
usernameEmpty
channel_idChannel ID if the entry targets one, otherwise empty
guild_idGuild ID
messageEmpty. Zoption keys: entryID, action (e.g. Member(Kick)), actionCode, targetID, reason, channelID, automodRuleName
trigger_message_idAudit log entry ID