From eda668037718e9ee8a99ea9f5773149c22fedce2 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 28 Apr 2021 01:37:26 -0400 Subject: Rename enums to use official API naming --- discord/enums.py | 14 +++++++------- discord/ui/button.py | 2 +- discord/ui/view.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'discord') diff --git a/discord/enums.py b/discord/enums.py index a06e473e..b7e4ee30 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -445,7 +445,7 @@ class InteractionResponseType(Enum): # channel_message = 3 (deprecated) channel_message = 4 # (with source) deferred_channel_message = 5 # (with source) - ack = 6 # for components? + deferred_message_update = 6 # for components class VideoQualityMode(Enum): auto = 1 @@ -455,18 +455,18 @@ class VideoQualityMode(Enum): return self.value class ComponentType(Enum): - group = 1 + action_row = 1 button = 2 def __int__(self): return self.value class ButtonStyle(Enum): - blurple = 1 - grey = 2 - green = 3 - red = 4 - hyperlink = 5 + primary = 1 + secondary = 2 + success = 3 + danger = 4 + link = 5 def __int__(self): return self.value diff --git a/discord/ui/button.py b/discord/ui/button.py index 0d156a96..b81266aa 100644 --- a/discord/ui/button.py +++ b/discord/ui/button.py @@ -222,7 +222,7 @@ def button( *, custom_id: Optional[str] = None, disabled: bool = False, - style: ButtonStyle = ButtonStyle.grey, + style: ButtonStyle = ButtonStyle.secondary, emoji: Optional[Union[str, PartialEmoji]] = None, group: Optional[int] = None, ) -> Callable[[ItemCallbackType], ItemCallbackType]: diff --git a/discord/ui/view.py b/discord/ui/view.py index 712f787a..d263da09 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -51,7 +51,7 @@ if TYPE_CHECKING: def _walk_all_components(components: List[Component]) -> Iterator[Component]: for item in components: - if item.type is ComponentType.group: + if item.type is ComponentType.action_row: yield from item.children else: yield item -- cgit v1.2.3