From 3547be4a53cdf1e011a86baaa735eaa4dd790a4e Mon Sep 17 00:00:00 2001 From: dolfies Date: Sat, 14 May 2022 11:04:52 -0400 Subject: [PATCH] Parse session_type --- discord/channel.py | 2 +- discord/state.py | 2 ++ discord/types/gateway.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/discord/channel.py b/discord/channel.py index 6eac21128..90ba6945a 100644 --- a/discord/channel.py +++ b/discord/channel.py @@ -2529,7 +2529,7 @@ class GroupChannel(discord.abc.Messageable, discord.abc.Connectable, Hashable): @property def owner(self) -> User: """:class:`User`: The owner that owns the group channel.""" - return utils.find(lambda u: u.id == self.owner_id, self.recipients) # type: ignore - All recipients are always present + return utils.find(lambda u: u.id == self.owner_id, self.recipients) # type: ignore # All recipients are always present @property def call(self) -> Optional[PrivateCall]: diff --git a/discord/state.py b/discord/state.py index 7dd2ce5af..517cfbf88 100644 --- a/discord/state.py +++ b/discord/state.py @@ -456,6 +456,7 @@ class ConnectionState: self.analytics_token: Optional[str] = None self.preferred_regions: List[str] = [] self.country_code: Optional[str] = None + self.session_type: Optional[str] = None self._emojis: Dict[int, Emoji] = {} self._stickers: Dict[int, GuildSticker] = {} self._guilds: Dict[int, Guild] = {} @@ -884,6 +885,7 @@ class ConnectionState: self.settings = UserSettings(data=data.get('user_settings', {}), state=self) self.consents = Tracking(data=data.get('consents', {}), state=self) self.country_code = data.get('country_code', 'US') + self.session_type = data.get('session_type', 'normal') if 'required_action' in data: # Locked more than likely self.parse_user_required_action_update(data) diff --git a/discord/types/gateway.py b/discord/types/gateway.py index f79912508..9b4e3d178 100644 --- a/discord/types/gateway.py +++ b/discord/types/gateway.py @@ -71,6 +71,7 @@ class ReadyEvent(TypedDict): required_action: NotRequired[str] sessions: List[dict] session_id: str + session_type: str user: User user_guild_settings: dict user_settings: dict