Browse Source

[types] Split PartialVoiceState for proper gateway type

pull/7032/head
Rapptz 4 years ago
parent
commit
c693945a46
  1. 4
      discord/types/guild.py
  2. 10
      discord/types/voice.py

4
discord/types/guild.py

@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE.
from typing import List, Literal, Optional, TypedDict from typing import List, Literal, Optional, TypedDict
from .snowflake import Snowflake from .snowflake import Snowflake
from .channel import GuildChannel from .channel import GuildChannel
from .voice import PartialVoiceState from .voice import GuildVoiceState
from .welcome_screen import WelcomeScreen from .welcome_screen import WelcomeScreen
from .activity import PartialPresenceUpdate from .activity import PartialPresenceUpdate
from .role import Role from .role import Role
@ -56,7 +56,7 @@ class _GuildOptional(TypedDict, total=False):
joined_at: Optional[str] joined_at: Optional[str]
large: bool large: bool
member_count: int member_count: int
voice_states: List[PartialVoiceState] voice_states: List[GuildVoiceState]
members: List[Member] members: List[Member]
channels: List[GuildChannel] channels: List[GuildChannel]
presences: List[PartialPresenceUpdate] presences: List[PartialPresenceUpdate]

10
discord/types/voice.py

@ -32,8 +32,7 @@ class _PartialVoiceStateOptional(TypedDict, total=False):
self_stream: bool self_stream: bool
class PartialVoiceState(_PartialVoiceStateOptional): class _VoiceState(_PartialVoiceStateOptional):
channel_id: Optional[Snowflake]
user_id: Snowflake user_id: Snowflake
session_id: str session_id: str
deaf: bool deaf: bool
@ -44,7 +43,12 @@ class PartialVoiceState(_PartialVoiceStateOptional):
suppress: bool suppress: bool
class VoiceState(PartialVoiceState, total=False): class GuildVoiceState(_VoiceState):
channel_id: Snowflake
class VoiceState(_VoiceState, total=False):
channel_id: Optional[Snowflake]
guild_id: Snowflake guild_id: Snowflake

Loading…
Cancel
Save