From 8ba78168a6e71cf8ade47b62e4659a720a13aa06 Mon Sep 17 00:00:00 2001 From: "Myst(MysterialPy)" Date: Wed, 7 Mar 2018 22:24:29 +1000 Subject: [PATCH] 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. --- discord/activity.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/discord/activity.py b/discord/activity.py index 46d2244ed..7ea60d05c 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