aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorppotatoo <[email protected]>2021-04-27 01:38:20 +0000
committerGitHub <[email protected]>2021-04-26 21:38:20 -0400
commitf4a861d76e123b96969cd8548d03614122595a60 (patch)
tree4170449c8240df20bc83a8ad1bd30e11fc9b4fa3
parentAdjust quickstart to not show commands example (diff)
downloaddiscord.py-f4a861d76e123b96969cd8548d03614122595a60.tar.xz
discord.py-f4a861d76e123b96969cd8548d03614122595a60.zip
Add __int__ to discord.Colour
-rw-r--r--discord/colour.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/discord/colour.py b/discord/colour.py
index 95a70806..2338aebf 100644
--- a/discord/colour.py
+++ b/discord/colour.py
@@ -53,6 +53,10 @@ class Colour:
.. describe:: str(x)
Returns the hex format for the colour.
+
+ .. describe:: int(x)
+
+ Returns the raw color value.
Attributes
------------
@@ -79,6 +83,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}>'