mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-08 10:53:10 +00:00
Split Game object to separate Activity subtypes for Rich Presences.
This is a massive breaking change. * All references to "game" have been renamed to "activity" * Activity objects contain a majority of the rich presence information * Game and Streaming are subtypes for memory optimisation purposes for the more common cases. * Introduce a more specialised read-only type, Spotify, for the official Spotify integration to make it easier to use.
This commit is contained in:
@ -28,7 +28,8 @@ from enum import Enum, IntEnum
|
||||
|
||||
__all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'VerificationLevel',
|
||||
'ContentFilter', 'Status', 'DefaultAvatar', 'RelationshipType',
|
||||
'AuditLogAction', 'AuditLogActionCategory', 'UserFlags', ]
|
||||
'AuditLogAction', 'AuditLogActionCategory', 'UserFlags',
|
||||
'ActivityType', ]
|
||||
|
||||
class ChannelType(Enum):
|
||||
text = 0
|
||||
@ -212,6 +213,14 @@ class UserFlags(Enum):
|
||||
partner = 2
|
||||
hypesquad = 4
|
||||
|
||||
class ActivityType(IntEnum):
|
||||
unknown = -1
|
||||
playing = 0
|
||||
streaming = 1
|
||||
listening = 2
|
||||
watching = 3
|
||||
|
||||
|
||||
def try_enum(cls, val):
|
||||
"""A function that tries to turn the value into enum ``cls``.
|
||||
|
||||
|
Reference in New Issue
Block a user