diff options
| author | Rapptz <[email protected]> | 2018-03-05 11:01:46 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2018-03-05 11:15:49 -0500 |
| commit | f8f8f418f3c51b6a885a1b6b7cd46c38c070b3bc (patch) | |
| tree | 0f26ed361806cf4470b8d98b61f63d2055cf87d0 /discord/enums.py | |
| parent | Update docstrings for channel.py (diff) | |
| download | discord.py-f8f8f418f3c51b6a885a1b6b7cd46c38c070b3bc.tar.xz discord.py-f8f8f418f3c51b6a885a1b6b7cd46c38c070b3bc.zip | |
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.
Diffstat (limited to 'discord/enums.py')
| -rw-r--r-- | discord/enums.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/discord/enums.py b/discord/enums.py index e215e482..f243359e 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -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``. |