Objects¶
Button¶
button
¶
Button
dataclass
¶
Bases: Part, Component, ActionRowChild, SectionAccessoryChild
flowchart TD
scurrypy.api.components.button.Button[Button]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ActionRowChild[ActionRowChild]
scurrypy.bases.components.SectionAccessoryChild[SectionAccessoryChild]
scurrypy.core.part.Part --> scurrypy.api.components.button.Button
scurrypy.bases.components.Component --> scurrypy.api.components.button.Button
scurrypy.bases.components.ActionRowChild --> scurrypy.api.components.button.Button
scurrypy.bases.components.SectionAccessoryChild --> scurrypy.api.components.button.Button
click scurrypy.api.components.button.Button href "" "scurrypy.api.components.button.Button"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ActionRowChild href "" "scurrypy.bases.components.ActionRowChild"
click scurrypy.bases.components.SectionAccessoryChild href "" "scurrypy.bases.components.SectionAccessoryChild"
A pressable button!
style: RequiredPartField[ButtonStyle] = None
class-attribute
instance-attribute
¶
A button style.
custom_id: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
ID for the button. Do not supply for ButtonStyles.LINK style buttons.
label: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
Text that appears on the button.
emoji: OptionalPartField[EmojiPart] = None
class-attribute
instance-attribute
¶
Emoji icon for the button.
url: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
URL for link-style buttons.
disabled: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether the button is disabled. Discord defaults to False.
type: ComponentType = field(init=False, default=(ComponentType.BUTTON))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.BUTTON for this class.
Layout¶
layout
¶
ActionRow
dataclass
¶
Bases: Part, ContainerComponent, Component
flowchart TD
scurrypy.api.components.layout.ActionRow[ActionRow]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.ContainerComponent[ContainerComponent]
scurrypy.bases.components.Component[Component]
scurrypy.core.part.Part --> scurrypy.api.components.layout.ActionRow
scurrypy.bases.components.ContainerComponent --> scurrypy.api.components.layout.ActionRow
scurrypy.bases.components.Component --> scurrypy.bases.components.ContainerComponent
scurrypy.bases.components.Component --> scurrypy.api.components.layout.ActionRow
click scurrypy.api.components.layout.ActionRow href "" "scurrypy.api.components.layout.ActionRow"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.ContainerComponent href "" "scurrypy.bases.components.ContainerComponent"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
Represents fields for creating a container of interactable components.
Section
dataclass
¶
Bases: Part, Component, ContainerChild
flowchart TD
scurrypy.api.components.layout.Section[Section]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ContainerChild[ContainerChild]
scurrypy.core.part.Part --> scurrypy.api.components.layout.Section
scurrypy.bases.components.Component --> scurrypy.api.components.layout.Section
scurrypy.bases.components.ContainerChild --> scurrypy.api.components.layout.Section
click scurrypy.api.components.layout.Section href "" "scurrypy.api.components.layout.Section"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ContainerChild href "" "scurrypy.bases.components.ContainerChild"
Represents fields for creating a section component.
A Section contextually associates content with an accessory component.
accessory: RequiredPartField[Component] = None
class-attribute
instance-attribute
¶
A component that is contextually associated to the content of the section.
Supports SectionAccessoryChild components.
components: RequiredPartField[list[Component]] = None
class-attribute
instance-attribute
¶
Component(s) representing the content of the section that is contextually associated to the accessory.
Supports SectionChild components.
type: ComponentType = field(init=False, default=(ComponentType.SECTION))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.SECTION for this class.
TextDisplay
dataclass
¶
Bases: Part, Component, ContainerChild, SectionChild
flowchart TD
scurrypy.api.components.layout.TextDisplay[TextDisplay]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ContainerChild[ContainerChild]
scurrypy.bases.components.SectionChild[SectionChild]
scurrypy.core.part.Part --> scurrypy.api.components.layout.TextDisplay
scurrypy.bases.components.Component --> scurrypy.api.components.layout.TextDisplay
scurrypy.bases.components.ContainerChild --> scurrypy.api.components.layout.TextDisplay
scurrypy.bases.components.SectionChild --> scurrypy.api.components.layout.TextDisplay
click scurrypy.api.components.layout.TextDisplay href "" "scurrypy.api.components.layout.TextDisplay"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ContainerChild href "" "scurrypy.bases.components.ContainerChild"
click scurrypy.bases.components.SectionChild href "" "scurrypy.bases.components.SectionChild"
Represents fields for creating a text display component.
A Text Display adds markdown formatted text, including mentions (users, roles, etc) and emojis.
content: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
Text that will be displayed similar to a message.
type: ComponentType = field(init=False, default=(ComponentType.TEXT_DISPLAY))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.TEXT_DISPLAY for this class.
Thumbnail
dataclass
¶
Bases: Part, Component, SectionAccessoryChild
flowchart TD
scurrypy.api.components.layout.Thumbnail[Thumbnail]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.SectionAccessoryChild[SectionAccessoryChild]
scurrypy.core.part.Part --> scurrypy.api.components.layout.Thumbnail
scurrypy.bases.components.Component --> scurrypy.api.components.layout.Thumbnail
scurrypy.bases.components.SectionAccessoryChild --> scurrypy.api.components.layout.Thumbnail
click scurrypy.api.components.layout.Thumbnail href "" "scurrypy.api.components.layout.Thumbnail"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.SectionAccessoryChild href "" "scurrypy.bases.components.SectionAccessoryChild"
Represents fields for creating a thumbnail component.
A Thumbnail displays visual media in a small form-factor.
media: RequiredPartField[UnfurledMediaPart] = None
class-attribute
instance-attribute
¶
Media of the thumbnail. URL or attachment scheme.
description: OptionalNullablePartField[str] = None
class-attribute
instance-attribute
¶
Description for the media.
spoiler: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether the thumbnail should be a spoiler (or blurred out). Discord defaults to False.
type: ComponentType = field(init=False, default=(ComponentType.THUMBNAIL))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.THUMBNAIL for this class.
MediaGalleryItem
dataclass
¶
Bases: Part
flowchart TD
scurrypy.api.components.layout.MediaGalleryItem[MediaGalleryItem]
scurrypy.core.part.Part[Part]
scurrypy.core.part.Part --> scurrypy.api.components.layout.MediaGalleryItem
click scurrypy.api.components.layout.MediaGalleryItem href "" "scurrypy.api.components.layout.MediaGalleryItem"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
Represents fields for creating a media gallery item component.
media: RequiredPartField[UnfurledMediaPart] = None
class-attribute
instance-attribute
¶
Image data. URL or attachment scheme.
description: OptionalNullablePartField[str] = None
class-attribute
instance-attribute
¶
Alt text for the media.
spoiler: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether the thumbnail should be a spoiler (or blurred out). Discord defaults to False.
MediaGallery
dataclass
¶
Bases: Part, Component, ContainerChild
flowchart TD
scurrypy.api.components.layout.MediaGallery[MediaGallery]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ContainerChild[ContainerChild]
scurrypy.core.part.Part --> scurrypy.api.components.layout.MediaGallery
scurrypy.bases.components.Component --> scurrypy.api.components.layout.MediaGallery
scurrypy.bases.components.ContainerChild --> scurrypy.api.components.layout.MediaGallery
click scurrypy.api.components.layout.MediaGallery href "" "scurrypy.api.components.layout.MediaGallery"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ContainerChild href "" "scurrypy.bases.components.ContainerChild"
Represents fields for creating a media gallery component.
A Media Gallery displays media attachments in an organized gallery format.
items: RequiredPartField[list[MediaGalleryItem]] = None
class-attribute
instance-attribute
¶
Media gallery items to display.
type: ComponentType = field(init=False, default=(ComponentType.MEDIA_GALLERY))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.MEDIA_GALLERY for this class.
File
dataclass
¶
Bases: Part, Component, ContainerChild
flowchart TD
scurrypy.api.components.layout.File[File]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ContainerChild[ContainerChild]
scurrypy.core.part.Part --> scurrypy.api.components.layout.File
scurrypy.bases.components.Component --> scurrypy.api.components.layout.File
scurrypy.bases.components.ContainerChild --> scurrypy.api.components.layout.File
click scurrypy.api.components.layout.File href "" "scurrypy.api.components.layout.File"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ContainerChild href "" "scurrypy.bases.components.ContainerChild"
Represents fields for creating a file component.
A File displays an uploaded file as an attachment to the message and reference it in the component.
file: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
File name. ONLY supports attachment://
spoiler: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether the thumbnail should be a spoiler (or blurred out). Discord defaults to False.
type: ComponentType = field(init=False, default=(ComponentType.FILE))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.FILE for this class.
Separator
dataclass
¶
Bases: Part, Component, ContainerChild
flowchart TD
scurrypy.api.components.layout.Separator[Separator]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ContainerChild[ContainerChild]
scurrypy.core.part.Part --> scurrypy.api.components.layout.Separator
scurrypy.bases.components.Component --> scurrypy.api.components.layout.Separator
scurrypy.bases.components.ContainerChild --> scurrypy.api.components.layout.Separator
click scurrypy.api.components.layout.Separator href "" "scurrypy.api.components.layout.Separator"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ContainerChild href "" "scurrypy.bases.components.ContainerChild"
Represents fields for creating a separator component.
A Separator adds vertical padding and visual division between other components.
divider: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether a visual divider should be displayed in the component. Discord defaults to True.
spacing: OptionalPartField[SeparatorType] = None
class-attribute
instance-attribute
¶
Size of separator padding. Discord defaults to SeparatorType.SMALL_PADDING.
type: ComponentType = field(init=False, default=(ComponentType.SEPARATOR))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.SEPARATOR for this class.
Container
dataclass
¶
Bases: Part, ContainerComponent
flowchart TD
scurrypy.api.components.layout.Container[Container]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.ContainerComponent[ContainerComponent]
scurrypy.bases.components.Component[Component]
scurrypy.core.part.Part --> scurrypy.api.components.layout.Container
scurrypy.bases.components.ContainerComponent --> scurrypy.api.components.layout.Container
scurrypy.bases.components.Component --> scurrypy.bases.components.ContainerComponent
click scurrypy.api.components.layout.Container href "" "scurrypy.api.components.layout.Container"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.ContainerComponent href "" "scurrypy.bases.components.ContainerComponent"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
Represents fields for creating a container of display and interactable components.
A Container visually encapsulates a collection of components.
components: RequiredPartField[list[Component]] = None
class-attribute
instance-attribute
¶
Child components that are encapsulated within the Container.
Supports ContainerChild components.
accent_color: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Color for the accent as an integer.
spoiler: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
If the container should be blurred out. Discord defaults to False.
type: ComponentType = field(init=False, default=(ComponentType.CONTAINER))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.CONTAINER for this class.
Label
dataclass
¶
flowchart TD
scurrypy.api.components.layout.Label[Label]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.core.part.Part --> scurrypy.api.components.layout.Label
scurrypy.bases.components.Component --> scurrypy.api.components.layout.Label
click scurrypy.api.components.layout.Label href "" "scurrypy.api.components.layout.Label"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
Represents fields for creating a Discord label component.
Labels wrap modal components with text as a label and optional description.
label: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
Label text.
component: RequiredPartField[Component] = None
class-attribute
instance-attribute
¶
A component within the label.
Supports LabelChild components.
description: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
An optional description text for the label.
type: ComponentType = field(init=False, default=(ComponentType.LABEL))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.LABEL for this class.
Modal¶
modal
¶
ModalPart
dataclass
¶
Bases: Part
flowchart TD
scurrypy.api.components.modal.ModalPart[ModalPart]
scurrypy.core.part.Part[Part]
scurrypy.core.part.Part --> scurrypy.api.components.modal.ModalPart
click scurrypy.api.components.modal.ModalPart href "" "scurrypy.api.components.modal.ModalPart"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
Represents fields for creating a modal.
title: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
Title of the popup modal.
custom_id: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the modal.
components: RequiredPartField[list[Label]] = None
class-attribute
instance-attribute
¶
1 to 5 components that make up the modal.
TextInput
dataclass
¶
Bases: Part, Component, LabelChild
flowchart TD
scurrypy.api.components.modal.TextInput[TextInput]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.core.part.Part --> scurrypy.api.components.modal.TextInput
scurrypy.bases.components.Component --> scurrypy.api.components.modal.TextInput
scurrypy.bases.components.LabelChild --> scurrypy.api.components.modal.TextInput
click scurrypy.api.components.modal.TextInput href "" "scurrypy.api.components.modal.TextInput"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a text input component.
A Text Input allows users to enter free-form text.
custom_id: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the input.
style: RequiredPartField[TextInputStyle] = None
class-attribute
instance-attribute
¶
Text input style.
min_length: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Minimum input length for a text input.
max_length: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Maximum input length for a text input.
required: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether this component is required to be filled. Discord defaults to True.
value: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
Pre-filled value for this component.
placeholder: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
Custom placeholder text if the input is empty.
type: ComponentType = field(init=False, default=(ComponentType.TEXT_INPUT))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.TEXT_INPUT for this class.
FileUpload
dataclass
¶
Bases: Part, Component, LabelChild
flowchart TD
scurrypy.api.components.modal.FileUpload[FileUpload]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.core.part.Part --> scurrypy.api.components.modal.FileUpload
scurrypy.bases.components.Component --> scurrypy.api.components.modal.FileUpload
scurrypy.bases.components.LabelChild --> scurrypy.api.components.modal.FileUpload
click scurrypy.api.components.modal.FileUpload href "" "scurrypy.api.components.modal.FileUpload"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a file upload component.
File Upload allows users to upload files in modals.
custom_id: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the file upload.
min_values: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Minimum number of items that must be uploaded. Discord defaults to 1.
max_values: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Maximum number of items that can be uploaded. Discord defaults to 1.
required: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether files are required to be uploaded. Discord defaults to True.
file_types: OptionalPartField[list[str]] = None
class-attribute
instance-attribute
¶
File types in which to filter (e.g., .pdf, .gif, .mp4, etc.).
type: ComponentType = field(init=False, default=(ComponentType.FILE_UPLOAD))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.FILE_UPLOAD for this class.
ListOption
dataclass
¶
Bases: Part
flowchart TD
scurrypy.api.components.modal.ListOption[ListOption]
scurrypy.core.part.Part[Part]
scurrypy.core.part.Part --> scurrypy.api.components.modal.ListOption
click scurrypy.api.components.modal.ListOption href "" "scurrypy.api.components.modal.ListOption"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
Represents fields for creating an option in a group or checkbox group component.
value: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the option.
label: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
User-facing label for the option.
description: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
Description for the option.
default: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether to show this option as selected by default.
RadioGroup
dataclass
¶
Bases: Part, Component, LabelChild
flowchart TD
scurrypy.api.components.modal.RadioGroup[RadioGroup]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.core.part.Part --> scurrypy.api.components.modal.RadioGroup
scurrypy.bases.components.Component --> scurrypy.api.components.modal.RadioGroup
scurrypy.bases.components.LabelChild --> scurrypy.api.components.modal.RadioGroup
click scurrypy.api.components.modal.RadioGroup href "" "scurrypy.api.components.modal.RadioGroup"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a radio group component.
A Radio Group is for selecting exactly one option from a defined list.
custom_id: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the radio group.
options: RequiredPartField[list[ListOption]] = None
class-attribute
instance-attribute
¶
List of options to show.
required: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether a selection is required for submission. Discord defaults to True.
type: ComponentType = field(init=False, default=(ComponentType.RADIO_GROUP))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.RADIO_GROUP for this class.
CheckboxGroup
dataclass
¶
Bases: Part, Component, LabelChild
flowchart TD
scurrypy.api.components.modal.CheckboxGroup[CheckboxGroup]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.core.part.Part --> scurrypy.api.components.modal.CheckboxGroup
scurrypy.bases.components.Component --> scurrypy.api.components.modal.CheckboxGroup
scurrypy.bases.components.LabelChild --> scurrypy.api.components.modal.CheckboxGroup
click scurrypy.api.components.modal.CheckboxGroup href "" "scurrypy.api.components.modal.CheckboxGroup"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a checkbox group component.
A Checkbox Group is for selecting one or many options via checkboxes.
custom_id: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the checkbox group.
options: RequiredPartField[list[ListOption]] = None
class-attribute
instance-attribute
¶
List of options to show.
min_values: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Minimum number of items that must be chosen. Discord defaults to 1.
max_values: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Maximum number of items that must be chosen. Discord defaults to 1.
required: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether a selection is required for submission. Discord defaults to the number of options.
type: ComponentType = field(init=False, default=(ComponentType.CHECKBOX_GROUP))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.CHECKBOX_GROUP for this class.
Checkbox
dataclass
¶
Bases: Part, Component, LabelChild
flowchart TD
scurrypy.api.components.modal.Checkbox[Checkbox]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.core.part.Part --> scurrypy.api.components.modal.Checkbox
scurrypy.bases.components.Component --> scurrypy.api.components.modal.Checkbox
scurrypy.bases.components.LabelChild --> scurrypy.api.components.modal.Checkbox
click scurrypy.api.components.modal.Checkbox href "" "scurrypy.api.components.modal.Checkbox"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a checkbox component.
A Checkbox is for simple yes/no style questions.
custom_id: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the option.
default: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether to show this option as selected by default.
type: ComponentType = field(init=False, default=(ComponentType.CHECKBOX))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.CHECKBOX for this class.
Select Menu¶
select_menu
¶
SelectOption
dataclass
¶
Bases: Part
flowchart TD
scurrypy.api.components.select_menu.SelectOption[SelectOption]
scurrypy.core.part.Part[Part]
scurrypy.core.part.Part --> scurrypy.api.components.select_menu.SelectOption
click scurrypy.api.components.select_menu.SelectOption href "" "scurrypy.api.components.select_menu.SelectOption"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
Represents fields for creating the select option component.
label: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
User-facing name of the option.
value: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
Developer-defined value of the option.
description: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
Additional description of the option.
emoji: OptionalPartField[EmojiPart] = None
class-attribute
instance-attribute
¶
Partial emoji object.
default: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether this option is selected by default. Discord defaults to False.
StringSelect
dataclass
¶
Bases: Part, Component, ActionRowChild, LabelChild
flowchart TD
scurrypy.api.components.select_menu.StringSelect[StringSelect]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ActionRowChild[ActionRowChild]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.core.part.Part --> scurrypy.api.components.select_menu.StringSelect
scurrypy.bases.components.Component --> scurrypy.api.components.select_menu.StringSelect
scurrypy.bases.components.ActionRowChild --> scurrypy.api.components.select_menu.StringSelect
scurrypy.bases.components.LabelChild --> scurrypy.api.components.select_menu.StringSelect
click scurrypy.api.components.select_menu.StringSelect href "" "scurrypy.api.components.select_menu.StringSelect"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ActionRowChild href "" "scurrypy.bases.components.ActionRowChild"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a string select component.
A String Select allows users to select one or more provided options.
custom_id: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the select menu.
options: RequiredPartField[list[SelectOption]] = None
class-attribute
instance-attribute
¶
Specified choices in a select menu.
placeholder: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
Placeholder text if nothing is selected or default.
min_values: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Minimum number of items that must be chosen. Discord defaults to 1.
max_values: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Maximum number of items that can be chosen. Discord defaults to 1.
required: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether the string select is required to answer in a modal. Discord defaults to True.
disabled: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether select menu is disabled in a message. Discord defaults to False.
Warning
Does not work on Modals!
type: ComponentType = field(init=False, default=(ComponentType.STRING_SELECT))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.STRING_SELECT for this class.
DefaultValue
dataclass
¶
Bases: Part
flowchart TD
scurrypy.api.components.select_menu.DefaultValue[DefaultValue]
scurrypy.core.part.Part[Part]
scurrypy.core.part.Part --> scurrypy.api.components.select_menu.DefaultValue
click scurrypy.api.components.select_menu.DefaultValue href "" "scurrypy.api.components.select_menu.DefaultValue"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
Represents fields for creating a default value for select components.
SelectMenuMixin
dataclass
¶
Bases: Part
flowchart TD
scurrypy.api.components.select_menu.SelectMenuMixin[SelectMenuMixin]
scurrypy.core.part.Part[Part]
scurrypy.core.part.Part --> scurrypy.api.components.select_menu.SelectMenuMixin
click scurrypy.api.components.select_menu.SelectMenuMixin href "" "scurrypy.api.components.select_menu.SelectMenuMixin"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
Represents common fields for Discord's select menus.
custom_id: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
ID for the select menu.
placeholder: OptionalPartField[str] = None
class-attribute
instance-attribute
¶
Placeholder text if nothing is selected.
default_values: OptionalPartField[list[DefaultValue]] = None
class-attribute
instance-attribute
¶
List of default values for auto-populated select menu components.
Number of default values must be in the range of min_values to max_values.
min_values: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Minimum number of items that must be chosen. Discord defaults to 1.
max_values: OptionalPartField[int] = None
class-attribute
instance-attribute
¶
Maximum number of items that can be chosen. Discord defaults to 1.
required: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether the select is required to answer in a modal. Discord defaults to True.
disabled: OptionalPartField[bool] = None
class-attribute
instance-attribute
¶
Whether select menu is disabled in a message. Discord defaults to False.
UserSelect
dataclass
¶
Bases: SelectMenuMixin, Component, ActionRowChild, LabelChild
flowchart TD
scurrypy.api.components.select_menu.UserSelect[UserSelect]
scurrypy.api.components.select_menu.SelectMenuMixin[SelectMenuMixin]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ActionRowChild[ActionRowChild]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.api.components.select_menu.SelectMenuMixin --> scurrypy.api.components.select_menu.UserSelect
scurrypy.core.part.Part --> scurrypy.api.components.select_menu.SelectMenuMixin
scurrypy.bases.components.Component --> scurrypy.api.components.select_menu.UserSelect
scurrypy.bases.components.ActionRowChild --> scurrypy.api.components.select_menu.UserSelect
scurrypy.bases.components.LabelChild --> scurrypy.api.components.select_menu.UserSelect
click scurrypy.api.components.select_menu.UserSelect href "" "scurrypy.api.components.select_menu.UserSelect"
click scurrypy.api.components.select_menu.SelectMenuMixin href "" "scurrypy.api.components.select_menu.SelectMenuMixin"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ActionRowChild href "" "scurrypy.bases.components.ActionRowChild"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a user select component.
User Select allows users to select one or more users.
type: ComponentType = field(init=False, default=(ComponentType.USER_SELECT))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.USER_SELECT for this class.
RoleSelect
dataclass
¶
Bases: SelectMenuMixin, Component, ActionRowChild, LabelChild
flowchart TD
scurrypy.api.components.select_menu.RoleSelect[RoleSelect]
scurrypy.api.components.select_menu.SelectMenuMixin[SelectMenuMixin]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ActionRowChild[ActionRowChild]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.api.components.select_menu.SelectMenuMixin --> scurrypy.api.components.select_menu.RoleSelect
scurrypy.core.part.Part --> scurrypy.api.components.select_menu.SelectMenuMixin
scurrypy.bases.components.Component --> scurrypy.api.components.select_menu.RoleSelect
scurrypy.bases.components.ActionRowChild --> scurrypy.api.components.select_menu.RoleSelect
scurrypy.bases.components.LabelChild --> scurrypy.api.components.select_menu.RoleSelect
click scurrypy.api.components.select_menu.RoleSelect href "" "scurrypy.api.components.select_menu.RoleSelect"
click scurrypy.api.components.select_menu.SelectMenuMixin href "" "scurrypy.api.components.select_menu.SelectMenuMixin"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ActionRowChild href "" "scurrypy.bases.components.ActionRowChild"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a role select component.
A Role Select allows users to select one or more roles
type: ComponentType = field(init=False, default=(ComponentType.ROLE_SELECT))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.ROLE_SELECT for this class.
MentionableSelect
dataclass
¶
Bases: SelectMenuMixin, Component, ActionRowChild, LabelChild
flowchart TD
scurrypy.api.components.select_menu.MentionableSelect[MentionableSelect]
scurrypy.api.components.select_menu.SelectMenuMixin[SelectMenuMixin]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ActionRowChild[ActionRowChild]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.api.components.select_menu.SelectMenuMixin --> scurrypy.api.components.select_menu.MentionableSelect
scurrypy.core.part.Part --> scurrypy.api.components.select_menu.SelectMenuMixin
scurrypy.bases.components.Component --> scurrypy.api.components.select_menu.MentionableSelect
scurrypy.bases.components.ActionRowChild --> scurrypy.api.components.select_menu.MentionableSelect
scurrypy.bases.components.LabelChild --> scurrypy.api.components.select_menu.MentionableSelect
click scurrypy.api.components.select_menu.MentionableSelect href "" "scurrypy.api.components.select_menu.MentionableSelect"
click scurrypy.api.components.select_menu.SelectMenuMixin href "" "scurrypy.api.components.select_menu.SelectMenuMixin"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ActionRowChild href "" "scurrypy.bases.components.ActionRowChild"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a mentionable select component.
A Mentionable Select allows users to select one or more mentionables.
type: ComponentType = field(init=False, default=(ComponentType.MENTIONABLE_SELECT))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.MENTIONABLE_SELECT for this class.
ChannelSelect
dataclass
¶
Bases: SelectMenuMixin, Component, ActionRowChild, LabelChild
flowchart TD
scurrypy.api.components.select_menu.ChannelSelect[ChannelSelect]
scurrypy.api.components.select_menu.SelectMenuMixin[SelectMenuMixin]
scurrypy.core.part.Part[Part]
scurrypy.bases.components.Component[Component]
scurrypy.bases.components.ActionRowChild[ActionRowChild]
scurrypy.bases.components.LabelChild[LabelChild]
scurrypy.api.components.select_menu.SelectMenuMixin --> scurrypy.api.components.select_menu.ChannelSelect
scurrypy.core.part.Part --> scurrypy.api.components.select_menu.SelectMenuMixin
scurrypy.bases.components.Component --> scurrypy.api.components.select_menu.ChannelSelect
scurrypy.bases.components.ActionRowChild --> scurrypy.api.components.select_menu.ChannelSelect
scurrypy.bases.components.LabelChild --> scurrypy.api.components.select_menu.ChannelSelect
click scurrypy.api.components.select_menu.ChannelSelect href "" "scurrypy.api.components.select_menu.ChannelSelect"
click scurrypy.api.components.select_menu.SelectMenuMixin href "" "scurrypy.api.components.select_menu.SelectMenuMixin"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
click scurrypy.bases.components.Component href "" "scurrypy.bases.components.Component"
click scurrypy.bases.components.ActionRowChild href "" "scurrypy.bases.components.ActionRowChild"
click scurrypy.bases.components.LabelChild href "" "scurrypy.bases.components.LabelChild"
Represents fields for creating a channel select component.
A Channel Select allows users to select one or more channels.
type: ComponentType = field(init=False, default=(ComponentType.CHANNEL_SELECT))
class-attribute
instance-attribute
¶
Component type. Always ComponentType.CHANNEL_SELECT for this class.
Unfurled Media¶
unfurled_media
¶
UnfurledMediaPart
dataclass
¶
Bases: Part
flowchart TD
scurrypy.api.components.unfurled_media.UnfurledMediaPart[UnfurledMediaPart]
scurrypy.core.part.Part[Part]
scurrypy.core.part.Part --> scurrypy.api.components.unfurled_media.UnfurledMediaPart
click scurrypy.api.components.unfurled_media.UnfurledMediaPart href "" "scurrypy.api.components.unfurled_media.UnfurledMediaPart"
click scurrypy.core.part.Part href "" "scurrypy.core.part.Part"
Represents fields for creating an unfurled media for Discord components.
Note
This part is a Components-specific structure. It is not meant to be used outside of Components.
url: RequiredPartField[str] = None
class-attribute
instance-attribute
¶
from_attachment
classmethod
¶
Convert a file name to attachment scheme.
Parameters:
-
filename(str) –file name
Returns:
-
UnfurledMediaPart–self