Add int() support to Hashable, making it available across the board for AuditLogEntry, *Channel, Guild, Object, Message, ...

This commit is contained in:
Arthur Jovart
2021-08-29 01:21:20 +02:00
parent 22de755059
commit 64ee792391
13 changed files with 79 additions and 5 deletions

View File

@@ -230,6 +230,7 @@ class Invite(Hashable):
Returns the invite URL.
The following table illustrates what methods will obtain the attributes:
+------------------------------------+------------------------------------------------------------+
@@ -433,6 +434,9 @@ class Invite(Hashable):
def __str__(self) -> str:
return self.url
def __int__(self) -> int:
return 0 # To keep the object compatible with the hashable abc.
def __repr__(self) -> str:
return (
f'<Invite code={self.code!r} guild={self.guild!r} '