aboutsummaryrefslogtreecommitdiff
path: root/discord/activity.py
diff options
context:
space:
mode:
authorMyst(MysterialPy) <[email protected]>2018-03-07 22:24:29 +1000
committerRapptz <[email protected]>2018-03-09 15:46:42 -0500
commit8ba78168a6e71cf8ade47b62e4659a720a13aa06 (patch)
tree607069098e5be2969f29d1ea31d6afd63451a8b7 /discord/activity.py
parentFix _image_url returning htps (diff)
downloaddiscord.py-8ba78168a6e71cf8ade47b62e4659a720a13aa06.tar.xz
discord.py-8ba78168a6e71cf8ade47b62e4659a720a13aa06.zip
Add Spotify intergration colour
Added property `colour` and alias `color` which returns the Spotify integration colour (#1db954). Technically Discord uses both (#1cb050 and #1db954) but it appears the former is an official Spotify colour.
Diffstat (limited to 'discord/activity.py')
-rw-r--r--discord/activity.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/discord/activity.py b/discord/activity.py
index 46d2244e..7ea60d05 100644
--- a/discord/activity.py
+++ b/discord/activity.py
@@ -25,6 +25,7 @@ DEALINGS IN THE SOFTWARE.
"""
from .enums import ActivityType, try_enum
+from .colour import Colour
import datetime
__all__ = ('Activity', 'Streaming', 'Game', 'Spotify')
@@ -456,6 +457,20 @@ class Spotify:
"""
return ActivityType.listening
+ @property
+ def colour(self):
+ """Returns the Spotify integration colour, as a :class:`Colour`.
+
+ There is an alias for this named :meth:`color`"""
+ return Colour(0x1db954)
+
+ @property
+ def color(self):
+ """Returns the Spotify integration colour, as a :class:`Colour`.
+
+ There is an alias for this named :meth:`colour`"""
+ return self.colour
+
def to_dict(self):
return {
'flags': 48, # SYNC | PLAY