Special methods #20

Merged
paris-ci merged 6 commits from special_methods into 2.0 2021-09-01 02:27:33 +00:00
Showing only changes of commit fa7f8efc8e - Show all commits

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),