AuditLogEntry
Represents an entry of an audit log.
Attributes
None | dict<str, AuditLogChange>
The changes of the entry.
None | dict<str, object>
Additional information for the specific action types.
int
The source guild's identifier.
int
The unique identifier number of the entry.
None
, str
The reason provided with the logged action.
int
The entry's target's identifier.
If no target is provided, this value defaults to 0
.
The logged event's type.
int
The user's identifier who triggered the event.
Reference to the audit log entry keys' parent.
Properties
created_at
When the entity was created.
Returns
created_at : datetime
guild
parent
target
Tries to resolve the target entity of the audit log entry.
If the entity is not cached, returns None
.
Returns
target : None
, Guild
, Channel
, ClientUserBase
, Role
, Webhook
,
user
Returns the user who triggered the event's creation.
Returns
user : None
, ClientUserBase
Returns ˙None if not an user triggered it.
Methods
(...)
__new__Creates a new audit log entry with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
changes |
| The changes of the entry. | ||
details |
| Additional information for the specific action types. | ||
entry_type |
| The logged event's type. | ||
guild_id |
| The source guild's identifier. | ||
reason |
| The reason provided with the logged action. | ||
target_id |
| The entry's target's identifier. | ||
user_id |
| The user's identifier who triggered the event. |
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
()
copyCopies the audit log entry.
Returns
new : instance<type<self>>
(...)
copy_withCopies the audit log entry with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
changes |
| The changes of the entry. | ||
details |
| Additional information for the specific action types. | ||
entry_type |
| The logged event's type. | ||
guild_id |
| The source guild's identifier. | ||
reason |
| The reason provided with the logged action. | ||
target_id |
| The entry's target's identifier. | ||
user_id |
| The user's identifier who triggered the event. |
Returns
new : instance<type<self>>
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
(data, ...)
from_dataCreates an audit log entry, from entry data sent inside of an AuditLog
's data and from the audit itself.
Parameter | Type | Optional | Default | Description |
---|---|---|---|---|
data |
| Data received from Discord. | ||
parent |
|
| The parent of the entry that contains the respective guild, the included users, webhooks and the integrations, etc... to work with. |
Returns
self : instance<cls>
Returns None
if Discord is derping like hell.
(attribute_name)
get_changeGets the audit log entry's change for the given attribute_name
.
Parameter | Type | Description |
---|---|---|
attribute_name |
| The change by its attribute name to get. |
Returns
change : None
, AuditLogChange
(name)
get_detailGets the audit log entry's detail for the given name
.
Parameter | Type | Description |
---|---|---|
name |
| The detail's name. |
Returns
change : None
, object
()
iter_changesIterates over the changes of the audit log entry.
This method is an iterable generator.
Yields
change : AuditLogChange
()
iter_detailsIterates over the details of the audit log entry.
This method is an iterable generator.
Yields
detail : (str, object)
(entry_id, ...)
precreateCreates a new audit log entry with the given fields.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
entry_id |
| The entry's unique identifier. | ||
changes |
| The changes of the entry. | ||
details |
| Additional information for the specific action types. | ||
parent |
| The parent audit log for the entry. | ||
**keyword_parameters | Keyword Parameters | Additional keyword parameters. | ||
entry_type |
| The logged event's type. | ||
guild |
| Alternative for | ||
guild_id |
| The source guild's identifier. | ||
reason |
| The reason provided with the logged action. | ||
target_id |
| The entry's target's identifier. | ||
user |
| Alternative for | ||
user_id |
| The user's identifier who triggered the event. |
Returns
self : instance<cls>
Raises
TypeError
- If a parameter's type is incorrect.
ValueError
- If a parameter's value is incorrect.
(...)
to_dataSerialises the audit log entry.
Parameter | Type | Optional | Keyword only | Description |
---|---|---|---|---|
defaults |
| Whether fields with their default values should be included as well. |
Returns
data : dict<str, object>
(other)
_is_equal_same_typeReturns whether the two audit log entries are equal.
Parameter | Type | Description |
---|---|---|
other |
| The other instance. Must be the same type as self. |
Returns
is_equal : bool
()
__eq__Returns whether the two audit log entries are equal.
()
__ge__Whether this entity's id is greater or equal than the other's.
()
__getattr__Drops a rich attribute error.
()
__gt__Whether this entity's id is greater than the other's.
()
__hash__Returns the audit log entry's hash value.
()
__le__Whether this entity's id is less or equal than the other's.
()
__lt__Whether this entity's id is less than the other's.
()
__ne__Returns whether the two audit log entries are not equal.
()
__repr__Returns the representation of the audit log entry.