aboutsummaryrefslogtreecommitdiff
path: root/discord/guild.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2018-03-05 11:01:46 -0500
committerRapptz <[email protected]>2018-03-05 11:15:49 -0500
commitf8f8f418f3c51b6a885a1b6b7cd46c38c070b3bc (patch)
tree0f26ed361806cf4470b8d98b61f63d2055cf87d0 /discord/guild.py
parentUpdate docstrings for channel.py (diff)
downloaddiscord.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/guild.py')
-rw-r--r--discord/guild.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/discord/guild.py b/discord/guild.py
index 37f0c60c..6141d0f2 100644
--- a/discord/guild.py
+++ b/discord/guild.py
@@ -32,7 +32,7 @@ from collections import namedtuple, defaultdict
from . import utils
from .role import Role
from .member import Member, VoiceState
-from .game import Game
+from .activity import create_activity
from .permissions import PermissionOverwrite
from .colour import Colour
from .errors import InvalidArgument, ClientException
@@ -243,8 +243,7 @@ class Guild(Hashable):
member = self.get_member(user_id)
if member is not None:
member.status = try_enum(Status, presence['status'])
- game = presence.get('game', {})
- member.game = Game(**game) if game else None
+ member.activity = create_activity(presence.get('game'))
if 'channels' in data:
channels = data['channels']