Browse Source

Parse session_type

pull/10109/head
dolfies 3 years ago
parent
commit
3547be4a53
  1. 2
      discord/channel.py
  2. 2
      discord/state.py
  3. 1
      discord/types/gateway.py

2
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]:

2
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)

1
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

Loading…
Cancel
Save