Audit

discord_http.audit module

class discord_http.audit.AuditChange(*, entry, data)

Bases: object

Represents a change in an audit log entry.

Parameters:
entry

The audit log entry this change belongs to.

key: str

The key of the change.

new_value: Any | None

The new value of the change, if applicable.

old_value: Any | None

The old value of the change, if applicable.

class discord_http.audit.AuditLogEntry(*, state, data, guild=None, users=None)

Bases: Snowflake

Represents an entry in an audit log.

Parameters:
guild: PartialGuild

The guild this audit log entry belongs to.

action_type: AuditLogType

The type of action that was performed.

reason: str | None

The reason for the action, if provided.

user_id: int | None

The ID of the user who performed the action, if available.

target_id: int | None

The ID of the target of the action, if available.

property created_at: datetime

The datetime of the snowflake.

id: int

The ID of the snowflake.

options: dict

Additional options related to the action, if any.

changes: list[AuditChange]

A list of changes made in this audit log entry.

property user: User | PartialUser | None

Returns the user object of the audit log if available.

property target: Snowflake | None

Returns the target object of the audit log.

The Snowflake can be a PartialChannel, User, PartialRole, etc