diff --git a/discord/read_state.py b/discord/read_state.py index 7df571df0c95..019ccb89aeeb 100644 --- a/discord/read_state.py +++ b/discord/read_state.py @@ -164,8 +164,8 @@ def flags(self) -> ReadStateFlags: 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 @@ def resource(self) -> Optional[Union[ClientUser, Guild, MessageableChannel]]: 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: diff --git a/discord/user.py b/discord/user.py index 3efe7887c50a..cf09eefd94c0 100644 --- a/discord/user.py +++ b/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 @@ def avatar_decoration(self) -> Optional[Asset]: 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.