"""The MIT License (MIT)Copyright (c) 2021-present Pycord DevelopmentPermission is hereby granted, free of charge, to any person obtaining acopy of this software and associated documentation files (the "Software"),to deal in the Software without restriction, including without limitationthe rights to use, copy, modify, merge, publish, distribute, sublicense,and/or sell copies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESSOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERDEALINGS IN THE SOFTWARE."""from__future__importannotationsfromtypingimportTYPE_CHECKING,ClassVar,Literalfromtyping_extensionsimportoverridefrom..enumsimportComponentType,SeparatorSpacingSize,try_enumfrom..types.component_typesimportSeparatorComponentasSeparatorComponentPayloadfrom.componentimportComponentifTYPE_CHECKING:fromtyping_extensionsimportSelf
[docs]classSeparator(Component[SeparatorComponentPayload]):"""Represents a Separator from Components V2. This is a component that visually separates components. This inherits from :class:`Component`. .. versionadded:: 2.7 .. versionchanged:: 3.0 Attributes ---------- type: Literal[:data:`ComponentType.separator`] The type of component. divider: :class:`bool` Whether the separator will show a horizontal line in addition to vertical spacing. spacing: :class:`SeparatorSpacingSize` | :data:`None` The separator's spacing size. id: :class:`int` | :data:`None` The separator's ID. Parameters ---------- divider: Whether the separator will show a horizontal line in addition to vertical spacing. Defaults to :data:`True`. spacing: The separator's spacing size. Defaults to :attr:`SeparatorSpacingSize.small`. id: The separator's ID. If not provided by the user, it is set sequentially by Discord. The ID `0` is treated as if no ID was provided. """__slots__:tuple[str,...]=("divider","spacing",)__repr_info__:ClassVar[tuple[str,...]]=__slots__versions:tuple[int,...]=(2,)type:Literal[ComponentType.separator]=ComponentType.separator# pyright: ignore[reportIncompatibleVariableOverride]def__init__(self,divider:bool=True,spacing:SeparatorSpacingSize=SeparatorSpacingSize.small,id:int|None=None)->None:self.divider:bool=dividerself.spacing:SeparatorSpacingSize=spacingsuper().__init__(id=id)@classmethod@overridedeffrom_payload(cls,payload:SeparatorComponentPayload)->Self:self=cls(divider=payload.get("divider",False),spacing=try_enum(SeparatorSpacingSize,payload.get("spacing",1)))self.id=payload.get("id")returnself@overridedefto_dict(self)->SeparatorComponentPayload:return{# pyright: ignore[reportReturnType]"type":int(self.type),"id":self.id,"divider":self.divider,"spacing":int(self.spacing),}# type: ignore