diff options
| author | Nadir Chowdhury <[email protected]> | 2021-03-01 13:55:53 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-03-01 08:55:53 -0500 |
| commit | 31bbf7434bc1dc14cdbb47c99d254bf99f133bfc (patch) | |
| tree | 5d9d4b60a4631edbd6dc920d848b7f58cb21dd34 | |
| parent | Disallow empty sequences in Guild.query_members user_id parameter (diff) | |
| download | discord.py-31bbf7434bc1dc14cdbb47c99d254bf99f133bfc.tar.xz discord.py-31bbf7434bc1dc14cdbb47c99d254bf99f133bfc.zip | |
Allow AuditLogEntry to be Hashable
| -rw-r--r-- | discord/audit_logs.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/discord/audit_logs.py b/discord/audit_logs.py index 95987fe3..7d70a93b 100644 --- a/discord/audit_logs.py +++ b/discord/audit_logs.py @@ -29,6 +29,7 @@ from .object import Object from .permissions import PermissionOverwrite, Permissions from .colour import Colour from .invite import Invite +from .mixins import Hashable def _transform_verification_level(entry, data): return enums.try_enum(enums.VerificationLevel, data) @@ -186,11 +187,28 @@ class AuditLogChanges: setattr(second, 'roles', data) -class AuditLogEntry: +class AuditLogEntry(Hashable): r"""Represents an Audit Log entry. 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 ----------- action: :class:`AuditLogAction` |