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.

Type:

AuditLogEntry

key

The key of the change.

Type:

str

old_value

The old value of the change, if applicable.

Type:

Any | None

new_value

The new value of the change, if applicable.

Type:

Any | None

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

Bases: Snowflake

Represents an entry in an audit log.

Parameters:
guild

The guild this audit log entry belongs to.

Type:

PartialGuild

action_type

The type of action that was performed.

Type:

enums.AuditLogType

reason

The reason for the action, if provided.

Type:

str | None

user_id

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

Type:

int | None

target_id

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

Type:

int | None

options

Additional options related to the action, if any.

Type:

dict

changes

A list of changes made in this audit log entry.

Type:

list[AuditChange]

property target: Snowflake | None

Returns the target object of the audit log.

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

property user: User | PartialUser | None

Returns the user object of the audit log if available.