Add int() support to Guild

This commit is contained in:
Arthur Jovart 2021-08-29 01:07:26 +02:00
parent 9d1df65af3
commit fa7f8efc8e
No known key found for this signature in database
GPG Key ID: DE4444AAAAAAAAAA

View File

@ -140,6 +140,10 @@ class Guild(Hashable):
Returns the guild's name.
.. describe:: int(x)
Returns the guild's ID.
Attributes
----------
name: :class:`str`
@ -335,6 +339,9 @@ class Guild(Hashable):
def __str__(self) -> str:
return self.name or ''
def __int__(self) -> int:
return self.id
def __repr__(self) -> str:
attrs = (
('id', self.id),