mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 08:17:47 +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:
|
||||
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
|
||||
|
@ -55,7 +55,7 @@ class StandardSticker(BaseSticker):
|
||||
|
||||
class GuildSticker(BaseSticker):
|
||||
type: Literal[2]
|
||||
available: bool
|
||||
available: NotRequired[bool]
|
||||
guild_id: Snowflake
|
||||
user: NotRequired[User]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user