Browse Source

Correct miscellaneous types

pull/10109/head
dolfies 1 year ago
parent
commit
e525cc357b
  1. 8
      discord/read_state.py
  2. 4
      discord/user.py

8
discord/read_state.py

@ -164,8 +164,8 @@ class ReadState:
return ReadStateFlags._from_value(self._flags)
@property
def resource(self) -> Optional[Union[ClientUser, Guild, MessageableChannel]]:
"""Optional[Union[:class:`ClientUser`, :class:`Guild`, :class:`TextChannel`, :class:`StageChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`, :class:`PartialMessageable`]]: The entity associated with the read state."""
def resource(self) -> Union[ClientUser, Guild, MessageableChannel]:
"""Union[:class:`ClientUser`, :class:`Guild`, :class:`TextChannel`, :class:`StageChannel`, :class:`VoiceChannel`, :class:`Thread`, :class:`DMChannel`, :class:`GroupChannel`, :class:`PartialMessageable`]: The entity associated with the read state."""
state = self._state
if self.type == ReadStateType.channel:
@ -173,7 +173,9 @@ class ReadState:
elif self.type in (ReadStateType.scheduled_events, ReadStateType.guild_home, ReadStateType.onboarding):
return state._get_or_create_unavailable_guild(self.id)
elif self.type == ReadStateType.notification_center and self.id == state.self_id:
return state.user
return state.user # type: ignore
else:
raise NotImplementedError(f'Unknown read state type {self.type!r}')
@property
def last_entity_id(self) -> int:

4
discord/user.py

@ -264,7 +264,7 @@ class BaseUser(_UserTag):
_state: ConnectionState
_avatar: Optional[str]
_avatar_decoration: Optional[str]
_avatar_decoration_sku_id: Optional[Snowflake]
_avatar_decoration_sku_id: Optional[int]
_banner: Optional[str]
_accent_colour: Optional[int]
_public_flags: int
@ -405,7 +405,7 @@ class BaseUser(_UserTag):
return None
@property
def avatar_decoration_sku_id(self) -> Optional[Snowflake]:
def avatar_decoration_sku_id(self) -> Optional[int]:
"""Optional[:class:`int`]: Returns the avatar decoration's SKU ID.
If the user does not have a preset avatar decoration, ``None`` is returned.

Loading…
Cancel
Save