mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-05-11 08:19:54 +00:00
Allow AuditLogEntry to be Hashable
This commit is contained in:
parent
4c4d75dc29
commit
31bbf7434b
@ -29,6 +29,7 @@ from .object import Object
|
|||||||
from .permissions import PermissionOverwrite, Permissions
|
from .permissions import PermissionOverwrite, Permissions
|
||||||
from .colour import Colour
|
from .colour import Colour
|
||||||
from .invite import Invite
|
from .invite import Invite
|
||||||
|
from .mixins import Hashable
|
||||||
|
|
||||||
def _transform_verification_level(entry, data):
|
def _transform_verification_level(entry, data):
|
||||||
return enums.try_enum(enums.VerificationLevel, data)
|
return enums.try_enum(enums.VerificationLevel, data)
|
||||||
@ -186,11 +187,28 @@ class AuditLogChanges:
|
|||||||
|
|
||||||
setattr(second, 'roles', data)
|
setattr(second, 'roles', data)
|
||||||
|
|
||||||
class AuditLogEntry:
|
class AuditLogEntry(Hashable):
|
||||||
r"""Represents an Audit Log entry.
|
r"""Represents an Audit Log entry.
|
||||||
|
|
||||||
You retrieve these via :meth:`Guild.audit_logs`.
|
You retrieve these via :meth:`Guild.audit_logs`.
|
||||||
|
|
||||||
|
.. container:: operations
|
||||||
|
|
||||||
|
.. describe:: x == y
|
||||||
|
|
||||||
|
Checks if two entries are equal.
|
||||||
|
|
||||||
|
.. describe:: x != y
|
||||||
|
|
||||||
|
Checks if two entries are not equal.
|
||||||
|
|
||||||
|
.. describe:: hash(x)
|
||||||
|
|
||||||
|
Returns the entry's hash.
|
||||||
|
|
||||||
|
.. versionchanged:: 1.7
|
||||||
|
Audit log entries are now comparable and hashable.
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
-----------
|
-----------
|
||||||
action: :class:`AuditLogAction`
|
action: :class:`AuditLogAction`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user