Skip to content

Select API Reference#

ChannelSelect #

ChannelSelect(
    *,
    channel_types: t.Sequence[hikari.ChannelType] = (
        hikari.ChannelType.GUILD_TEXT
    ),
    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: SelectBase

A view component representing a select menu of channels.

PARAMETER DESCRIPTION
channel_types

A sequence of channel types to filter the select menu by

TYPE: t.Sequence[int | hikari.ChannelType] DEFAULT: (hikari.ChannelType.GUILD_TEXT)

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

min_values

The minimum values a user has to select before it can be sent

TYPE: int DEFAULT: 1

max_values

The maximum values a user can select

TYPE: int DEFAULT: 1

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

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.

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.

channel_types property writable #

channel_types: t.Sequence[hikari.ChannelType]

The valid channel types that can be selected from the select menu.

type property #

The component's underlying component type.

values property #

The currently selected channels.

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

MentionableSelect #

MentionableSelect(
    *,
    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: SelectBase

A view component representing a select menu of mentionables.

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

min_values

The minimum values a user has to select before it can be sent

TYPE: int DEFAULT: 1

max_values

The maximum values a user can select

TYPE: int DEFAULT: 1

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

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.

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.

type property #

The component's underlying component type.

values property #

values: hikari.ResolvedOptionData | None

The currently selected mentionable objects.

This is returned as a hikari.ResolvedOptionData object. You can access each type of mentionable object by using the following attributes:

  • values.users - All user objects selected
  • values.roles - All role objects selected
  • values.channels - All channel objects selected
  • values.members - All member objects selected

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

RoleSelect #

RoleSelect(
    *,
    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: SelectBase

A view component representing a select menu of roles.

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

min_values

The minimum values a user has to select before it can be sent

TYPE: int DEFAULT: 1

max_values

The maximum values a user can select

TYPE: int DEFAULT: 1

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

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.

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.

type property #

The component's underlying component type.

values property #

values: t.Sequence[hikari.Role]

The currently selected user objects.

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

SelectOption #

SelectOption(
    label: str,
    value: str | None = None,
    description: str | None = None,
    emoji: str | hikari.Emoji | None = None,
    is_default: bool = False,
)

A more lenient way to instantiate select options.

A more lenient way to instantiate select options.

PARAMETER DESCRIPTION
label

The option's label.

TYPE: str

value

The internal value of the option, if None, uses label.

TYPE: str | None DEFAULT: None

description

The description of the option

TYPE: str | None DEFAULT: None

emoji

The emoji of the option

TYPE: str | hikari.Emoji | None DEFAULT: None

is_default

A boolean determining of the option is default or not

TYPE: bool DEFAULT: False

TextSelect #

TextSelect(
    *,
    options: t.Sequence[
        hikari.SelectMenuOption | SelectOption
    ],
    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: SelectBase

A view component representing a text select menu.

PARAMETER DESCRIPTION
options

A sequence of select menu options that this select menu should use.

TYPE: t.Sequence[hikari.SelectMenuOption | SelectOption]

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

min_values

The minimum values a user has to select before it can be sent

TYPE: int DEFAULT: 1

max_values

The maximum values a user can select

TYPE: int DEFAULT: 1

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.

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.

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.

options property writable #

The select menu's options.

type property #

The component's underlying component type.

placeholder property writable #

placeholder: str | None

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

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

UserSelect #

UserSelect(
    *,
    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: SelectBase

A view component representing a select menu of users.

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

min_values

The minimum values a user has to select before it can be sent

TYPE: int DEFAULT: 1

max_values

The maximum values a user can select

TYPE: int DEFAULT: 1

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

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.

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.

type property #

The component's underlying component type.

values property #

values: t.Sequence[hikari.User]

The currently selected user objects. Some users may also be instances of hikari.InteractionMember, depending on how they were resolved.

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

channel_select #

channel_select(
    *,
    channel_types: t.Sequence[hikari.ChannelType] = (
        hikari.ChannelType.GUILD_TEXT
    ),
    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
) -> t.Callable[
    [
        t.Callable[
            [ViewT, ViewContext, ChannelSelect],
            t.Awaitable[None],
        ]
    ],
    DecoratedItem[ViewT, ChannelSelect],
]

A decorator to transform a function into a Discord UI ChannelSelectMenu's callback. This must be inside a subclass of View.

PARAMETER DESCRIPTION
channel_types

A sequence of channel types to filter the select menu by.

TYPE: t.Sequence[int | hikari.ChannelType] DEFAULT: (hikari.ChannelType.GUILD_TEXT)

custom_id

The custom ID of the select menu

TYPE: str | None DEFAULT: None

placeholder

The placeholder to display when nothing is selected

TYPE: str | None DEFAULT: None

min_values

The minimum number of values that can be selected

TYPE: int DEFAULT: 1

max_values

The maximum number of values that can be selected

TYPE: int DEFAULT: 1

disabled

Whether the select menu is disabled

TYPE: bool DEFAULT: False

row

The row the select 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

RETURNS DESCRIPTION
t.Callable[[Callable[[ViewT, ViewContext, ChannelSelect], Awaitable[None]]], DecoratedItem[ViewT, ChannelSelect]]

The decorated function.

RAISES DESCRIPTION
TypeError

If the decorated function is not a coroutine function.

mentionable_select #

mentionable_select(
    *,
    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
) -> t.Callable[
    [
        t.Callable[
            [ViewT, ViewContext, MentionableSelect],
            t.Awaitable[None],
        ]
    ],
    DecoratedItem[ViewT, MentionableSelect],
]

A decorator to transform a function into a Discord UI MentionableSelectMenu's callback. This must be inside a subclass of View.

PARAMETER DESCRIPTION
custom_id

The custom ID of the select menu

TYPE: str | None DEFAULT: None

placeholder

Placeholder text displayed on the select menu

TYPE: str | None DEFAULT: None

min_values

The minimum number of values that can be selected.

TYPE: int DEFAULT: 1

max_values

The maximum number of values that can be selected.

TYPE: int DEFAULT: 1

disabled

Whether the select menu is disabled.

TYPE: bool DEFAULT: False

row

The row the select 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

RETURNS DESCRIPTION
Callable[[Callable[[ViewT, ViewContext, MentionableSelect], Awaitable[None]]], DecoratedItem[ViewT, MentionableSelect]]

The decorated function.

RAISES DESCRIPTION
TypeError

If the decorated function is not a coroutine function.

role_select #

role_select(
    *,
    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
) -> t.Callable[
    [
        t.Callable[
            [ViewT, ViewContext, RoleSelect],
            t.Awaitable[None],
        ]
    ],
    DecoratedItem[ViewT, RoleSelect],
]

A decorator to transform a function into a Discord UI RoleSelectMenu's callback. This must be inside a subclass of View.

PARAMETER DESCRIPTION
custom_id

The custom ID of the select menu

TYPE: str | None DEFAULT: None

placeholder

Placeholder text displayed on the select menu

TYPE: str | None DEFAULT: None

min_values

The minimum number of values that can be selected.

TYPE: int DEFAULT: 1

max_values

The maximum number of values that can be selected.

TYPE: int DEFAULT: 1

disabled

Whether the select menu is disabled. Defaults to False.

TYPE: bool DEFAULT: False

row

The row the select 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

RETURNS DESCRIPTION
Callable[[Callable[[ViewT, ViewContext, RoleSelect], Awaitable[None]]], DecoratedItem[ViewT, RoleSelect]]

The decorated function.

RAISES DESCRIPTION
TypeError

If the decorated function is not a coroutine function.

text_select #

text_select(
    *,
    options: t.Sequence[
        hikari.SelectMenuOption | SelectOption
    ],
    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
) -> t.Callable[
    [
        t.Callable[
            [ViewT, ViewContext, TextSelect],
            t.Awaitable[None],
        ]
    ],
    DecoratedItem[ViewT, TextSelect],
]

A decorator to transform a function into a Discord UI TextSelectMenu's callback. This must be inside a subclass of View.

PARAMETER DESCRIPTION
options

A sequence of select menu options that this select menu should use.

TYPE: t.Sequence[hikari.SelectMenuOption | SelectOption]

custom_id

The custom ID of the select menu.

TYPE: str | None DEFAULT: None

placeholder

Placeholder text displayed on the select menu.

TYPE: str | None DEFAULT: None

min_values

The minimum number of values that can be selected.

TYPE: int DEFAULT: 1

max_values

The maximum number of values that can be selected.

TYPE: int DEFAULT: 1

disabled

Whether the select menu is disabled.

TYPE: bool DEFAULT: False

row

The row the select 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

RETURNS DESCRIPTION
Callable[[Callable[[ViewT, ViewContext, TextSelect], Awaitable[None]]], DecoratedItem[ViewT, TextSelect]]

The decorated function.

RAISES DESCRIPTION
TypeError

If the decorated function is not a coroutine function.

user_select #

user_select(
    *,
    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
) -> t.Callable[
    [
        t.Callable[
            [ViewT, ViewContext, UserSelect],
            t.Awaitable[None],
        ]
    ],
    DecoratedItem[ViewT, UserSelect],
]

A decorator to transform a function into a Discord UI UserSelectMenu's callback. This must be inside a subclass of View.

PARAMETER DESCRIPTION
custom_id

The custom ID of the select menu

TYPE: str | None DEFAULT: None

placeholder

Placeholder text displayed on the select menu

TYPE: str | None DEFAULT: None

min_values

The minimum number of values that can be selected.

TYPE: int DEFAULT: 1

max_values

The maximum number of values that can be selected.

TYPE: int DEFAULT: 1

disabled

Whether the select menu is disabled.

TYPE: bool DEFAULT: False

row

The row the select 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

RETURNS DESCRIPTION
Callable[[Callable[[ViewT, ViewContext, UserSelect], Awaitable[None]]], DecoratedItem[ViewT, UserSelect]]

The decorated function.

RAISES DESCRIPTION
TypeError

If the decorated function is not a coroutine function.