mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
Fix 'available' KeyError for GuildSticker
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
parent
ee9e549836
commit
ab287e71b8
@ -414,7 +414,7 @@ class GuildSticker(Sticker):
|
|||||||
|
|
||||||
def _from_data(self, data: GuildStickerPayload) -> None:
|
def _from_data(self, data: GuildStickerPayload) -> None:
|
||||||
super()._from_data(data)
|
super()._from_data(data)
|
||||||
self.available: bool = data['available']
|
self.available: bool = data.get('available', True)
|
||||||
self.guild_id: int = int(data['guild_id'])
|
self.guild_id: int = int(data['guild_id'])
|
||||||
user = data.get('user')
|
user = data.get('user')
|
||||||
self.user: Optional[User] = self._state.store_user(user) if user else None
|
self.user: Optional[User] = self._state.store_user(user) if user else None
|
||||||
|
@ -55,7 +55,7 @@ class StandardSticker(BaseSticker):
|
|||||||
|
|
||||||
class GuildSticker(BaseSticker):
|
class GuildSticker(BaseSticker):
|
||||||
type: Literal[2]
|
type: Literal[2]
|
||||||
available: bool
|
available: NotRequired[bool]
|
||||||
guild_id: Snowflake
|
guild_id: Snowflake
|
||||||
user: NotRequired[User]
|
user: NotRequired[User]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user