Add __int__ to discord.Colour

This commit is contained in:
ppotatoo 2021-04-27 01:38:20 +00:00 committed by GitHub
parent 686e531624
commit f4a861d76e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,10 @@ class Colour:
Returns the hex format for the colour.
.. describe:: int(x)
Returns the raw color value.
Attributes
------------
value: :class:`int`
@ -80,6 +84,9 @@ class Colour:
def __str__(self):
return f'#{self.value:0>6x}'
def __int__(self):
return self.value
def __repr__(self):
return f'<Colour value={self.value}>'