AuditLogEntry

class AuditLogEntry

Base class for all audit log entries. Use a subclass narrowed by actionType for typed change access.

Properties

Property

Type

Description

actionType

AuditLogActionType

The type of action this entry represents.

changes

Record<string, { newValue?: unknown; oldValue?: unknown; }>

Raw changes object (use subclass for typed access).

id

string

The ID of the audit log entry.

options

Record<string, unknown> | null

Additional action metadata supplied by Discord, or null.

reason

string | null

Reason for the action, or null if not provided.

targetId

string | null

The ID of the affected resource (user, channel, role, etc.), or null.

user

User | null

User who performed the audited action, or null if Discord omitted it.

userId

string | null

The ID of the user who performed the action, or null.

Methods

static AuditLogEntry.create(data: Record<string, unknown>) → AnyAuditLogEntry

Creates the appropriate typed subclass based on actionType.