From 6cc3e572ba1b9400b43e4f5abd6b70ef7224c127 Mon Sep 17 00:00:00 2001 From: Zomatree <39768508+Zomatree@users.noreply.github.com> Date: Fri, 28 May 2021 03:33:13 +0100 Subject: Button labels can be None --- discord/components.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'discord/components.py') diff --git a/discord/components.py b/discord/components.py index 853ea1ed..924c2152 100644 --- a/discord/components.py +++ b/discord/components.py @@ -106,8 +106,8 @@ class Button(Component): The URL this button sends you to. disabled: :class:`bool` Whether the button is disabled or not. - label: :class:`str` - The label of the button. + label: Optional[:class:`str`] + The label of the button, if any. emoji: Optional[:class:`PartialEmoji`] The emoji of the button, if available. """ @@ -127,7 +127,7 @@ class Button(Component): self.custom_id: Optional[str] = data.get('custom_id') self.url: Optional[str] = data.get('url') self.disabled: bool = data.get('disabled', False) - self.label: str = data['label'] + self.label: Optional[str] = data.get('label') self.emoji: Optional[PartialEmoji] try: self.emoji = PartialEmoji.from_dict(data['emoji']) -- cgit v1.2.3