Add int() support to Guild
This commit is contained in:
parent
9d1df65af3
commit
fa7f8efc8e
@ -140,6 +140,10 @@ class Guild(Hashable):
|
|||||||
|
|
||||||
Returns the guild's name.
|
Returns the guild's name.
|
||||||
|
|
||||||
|
.. describe:: int(x)
|
||||||
|
|
||||||
|
Returns the guild's ID.
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
----------
|
----------
|
||||||
name: :class:`str`
|
name: :class:`str`
|
||||||
@ -335,6 +339,9 @@ class Guild(Hashable):
|
|||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return self.name or ''
|
return self.name or ''
|
||||||
|
|
||||||
|
def __int__(self) -> int:
|
||||||
|
return self.id
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
attrs = (
|
attrs = (
|
||||||
('id', self.id),
|
('id', self.id),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user