Skip to content

Select ABC API Reference#

SelectBase #

SelectBase(
    *,
    custom_id: str | None = None,
    placeholder: str | None = None,
    min_values: int = 1,
    max_values: int = 1,
    disabled: bool = False,
    row: int | None = None,
    autodefer: (
        bool | AutodeferOptions | hikari.UndefinedType
    ) = hikari.UNDEFINED
)

Bases: InteractiveViewItem, abc.ABC

A view component representing some type of select menu. All types of selects derive from this class.

PARAMETER DESCRIPTION
custom_id

The custom identifier of the select menu

TYPE: str | None DEFAULT: None

placeholder

Placeholder text displayed on the select menu

TYPE: str | None DEFAULT: None

disabled

A boolean determining if the select menu should be disabled or not

TYPE: bool DEFAULT: False

row

The row the select menu should be in, leave as None for auto-placement.

TYPE: int | None DEFAULT: None

autodefer

The autodefer options for the select menu. If left UNDEFINED, the view's autodefer options will be used.

TYPE: bool | AutodeferOptions | hikari.UndefinedType DEFAULT: hikari.UNDEFINED

RAISES DESCRIPTION
ValueError

Exceeded the maximum of 25 select menu options possible.

row property writable #

row: int | None

The row the item should occupy. Leave as None for automatic placement.

position property writable #

position: int | None

The position of the item within the row it occupies.

custom_id property writable #

custom_id: str

The item's custom identifier. This will be used to track the item through interactions and is required for persistent views.

width property #

width: int

The item's width taken up in a Discord UI action row.

type abstractmethod property #

The component's underlying component type.

view property #

view: View

The view this item is attached to.

disabled property writable #

disabled: bool

Indicates whether the item is disabled or not.

autodefer property #

Indicates whether the item should be deferred automatically. If left as UNDEFINED, the view's autodefer option will be used.

placeholder property writable #

placeholder: str | None

The placeholder text that appears before the select menu is clicked.

min_values property writable #

min_values: int

The minimum amount of options a user has to select.

max_values property writable #

max_values: int

The maximum amount of options a user is allowed to select.

callback async #

callback(context: ViewContext) -> None

The component's callback, gets called when the component receives an interaction.

PARAMETER DESCRIPTION
context

The context, proxying the incoming interaction.

TYPE: ViewContextT