Skip to content

Commit

Permalink
Add Spotify intergration colour
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
EvieePy authored and Rapptz committed Mar 9, 2018
1 parent 31cc4c3 commit 8ba7816
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions discord/activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"""

from .enums import ActivityType, try_enum
from .colour import Colour
import datetime

__all__ = ('Activity', 'Streaming', 'Game', 'Spotify')
Expand Down Expand Up @@ -456,6 +457,20 @@ def type(self):
"""
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
Expand Down

0 comments on commit 8ba7816

Please sign in to comment.