AuditLog

Whenever an admin action is performed on the API, an audit log entry is added to the respective guild's audit logs. This class represents a requested collections of these entries.

Attributes

application_commands : dict of (int, ApplicationCommand) items

A dictionary that contains the mentioned application commands by the audi log entries. The keys are the id-s of the application commands, meanwhile the values are the application commands themselves.

auto_moderation_rules : dict of (int, ApplicationCommand) items

A dictionary that contains the auto moderation rules mentioned inside of the audit log entries. The keys are the id-s of the rules and the values are the rules themselves.

entries : list of AuditLogEntry

A list of audit log entries that the audit log contains.

guild_id : int

The audit logs' respective guild's identifier.

integrations : dict of (int, Integration) items

A dictionary that contains the mentioned integrations by the audit log's entries. The keys are the id-s of the integrations, meanwhile the values are the integrations themselves.

scheduled_events : dict of (int, ScheduledEvent) items

A dictionary containing the scheduled events mentioned inside of the audit logs.

threads : dict of (int, Channel) items

A dictionary containing the mentioned threads inside of the audit logs.

users : dict of (int, ClientUserBase) items

A dictionary that contains the mentioned users by the audit log's entries. The keys are the id-s of the users, meanwhile the values are the users themselves.

webhooks : dict of (int, Webhook) items

A dictionary that contains the mentioned webhook by the audit log's entries. The keys are the id-s of the webhooks, meanwhile the values are the values themselves.

_self_reference : None or WeakReferer to AuditLog

Weak reference to the audit log itself.

Properties

guild

Returns the audit log's guild.

Returns

guild : None, Guild

Methods

__new__(data, ...)

Creates an AuditLog from the data received from Discord.

ParameterTypeOptionalDefaultDescription
data

None, dict of (str, object) items

Data received from Discord.

guild_id

int

0

The respective guild's identifier of the audit logs.

_get_self_reference()

_populate(data)

Populates the audit log entry with the given data.

ParameterTypeDescription
data

dict(str, object) items

Audit log data.

Returns

populated : bool

Whether any entry was added to the audit log.

__getattr__()

Drops a rich attribute error.

__getitem__()

Returns the specific audit log entry at the given index.

__iter__()

Iterates over the audit log's entries.

__len__()

Returns the amount of entries that the audit lgo contain.

__repr__()

Returns the representation of the Audit log.

__reversed__()

Reversed iterator over the audit log's entries.