diff --git a/discord/components.py b/discord/components.py index 4767a1a3e..e5d7bb9be 100644 --- a/discord/components.py +++ b/discord/components.py @@ -42,7 +42,7 @@ from .enums import ( TextStyle, ChannelType, SelectDefaultValueType, - SeparatorSize, + SeparatorSpacing, MediaItemLoadingState, ) from .flags import AttachmentFlags @@ -1158,7 +1158,7 @@ class SeparatorComponent(Component): Attributes ---------- - spacing: :class:`SeparatorSize` + spacing: :class:`SeparatorSpacing` The spacing size of the separator. visible: :class:`bool` Whether this separator is visible and shows a divider. @@ -1178,7 +1178,7 @@ class SeparatorComponent(Component): self, data: SeparatorComponentPayload, ) -> None: - self.spacing: SeparatorSize = try_enum(SeparatorSize, data.get('spacing', 1)) + self.spacing: SeparatorSpacing = try_enum(SeparatorSpacing, data.get('spacing', 1)) self.visible: bool = data.get('divider', True) self.id: Optional[int] = data.get('id') diff --git a/discord/enums.py b/discord/enums.py index 49684935f..226e98071 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -77,7 +77,7 @@ __all__ = ( 'VoiceChannelEffectAnimationType', 'SubscriptionStatus', 'MessageReferenceType', - 'SeparatorSize', + 'SeparatorSpacing', 'MediaItemLoadingState', ) @@ -872,7 +872,7 @@ class SubscriptionStatus(Enum): inactive = 2 -class SeparatorSize(Enum): +class SeparatorSpacing(Enum): small = 1 large = 2 diff --git a/discord/ui/separator.py b/discord/ui/separator.py index e7d75a998..76c1a5275 100644 --- a/discord/ui/separator.py +++ b/discord/ui/separator.py @@ -27,7 +27,7 @@ from typing import TYPE_CHECKING, Literal, Optional, TypeVar from .item import Item from ..components import SeparatorComponent -from ..enums import SeparatorSize, ComponentType +from ..enums import SeparatorSpacing, ComponentType if TYPE_CHECKING: from typing_extensions import Self @@ -51,7 +51,7 @@ class Separator(Item[V]): visible: :class:`bool` Whether this separator is visible. On the client side this is whether a divider line should be shown or not. - spacing: :class:`.SeparatorSize` + spacing: :class:`.SeparatorSpacing` The spacing of this separator. row: Optional[:class:`int`] The relative row this separator belongs to. By default @@ -68,7 +68,7 @@ class Separator(Item[V]): self, *, visible: bool = True, - spacing: SeparatorSize = SeparatorSize.small, + spacing: SeparatorSpacing = SeparatorSpacing.small, row: Optional[int] = None, id: Optional[int] = None, ) -> None: @@ -99,12 +99,12 @@ class Separator(Item[V]): self._underlying.visible = value @property - def spacing(self) -> SeparatorSize: - """:class:`.SeparatorSize`: The spacing of this separator.""" + def spacing(self) -> SeparatorSpacing: + """:class:`.SeparatorSpacing`: The spacing of this separator.""" return self._underlying.spacing @spacing.setter - def spacing(self, value: SeparatorSize) -> None: + def spacing(self, value: SeparatorSpacing) -> None: self._underlying.spacing = value @property diff --git a/discord/ui/view.py b/discord/ui/view.py index 99e5f89e2..4a7afa50c 100644 --- a/discord/ui/view.py +++ b/discord/ui/view.py @@ -70,7 +70,7 @@ from ..components import ( SelectOption, ) from ..utils import get as _utils_get, _get_as_snowflake -from ..enums import SeparatorSize, TextStyle, try_enum, ButtonStyle +from ..enums import SeparatorSpacing, TextStyle, try_enum, ButtonStyle from ..emoji import PartialEmoji # fmt: off @@ -260,7 +260,7 @@ def _component_data_to_item(data: ComponentPayload) -> Item: return Separator( visible=data.get('divider', True), - spacing=try_enum(SeparatorSize, data.get('spacing', 1)), + spacing=try_enum(SeparatorSpacing, data.get('spacing', 1)), id=data.get('id'), ) elif data['type'] == 17: