From ab287e71b8961cbe245e60ad220b7d0be9fd0b8a Mon Sep 17 00:00:00 2001 From: Vish M Date: Sat, 1 Apr 2023 09:57:00 +0100 Subject: [PATCH] Fix 'available' KeyError for GuildSticker Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com> --- discord/sticker.py | 2 +- discord/types/sticker.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/sticker.py b/discord/sticker.py index 2872f3663..225e7648a 100644 --- a/discord/sticker.py +++ b/discord/sticker.py @@ -414,7 +414,7 @@ class GuildSticker(Sticker): def _from_data(self, data: GuildStickerPayload) -> None: super()._from_data(data) - self.available: bool = data['available'] + self.available: bool = data.get('available', True) self.guild_id: int = int(data['guild_id']) user = data.get('user') self.user: Optional[User] = self._state.store_user(user) if user else None diff --git a/discord/types/sticker.py b/discord/types/sticker.py index 7dcd0ccba..15fd034a7 100644 --- a/discord/types/sticker.py +++ b/discord/types/sticker.py @@ -55,7 +55,7 @@ class StandardSticker(BaseSticker): class GuildSticker(BaseSticker): type: Literal[2] - available: bool + available: NotRequired[bool] guild_id: Snowflake user: NotRequired[User]