NavItems API Reference#
NavItem
#
NavItem(
*,
custom_id: str | None = None,
row: int | None = None,
position: int | None = None,
disabled: bool = False,
width: int = 1
)
An abstract base for all navigation items. NavigatorView requires instances of this class as it's items.
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.
type
abstractmethod
property
#
type: hikari.ComponentType
The component's underlying component type.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
InteractiveNavItem
#
InteractiveNavItem(
*,
custom_id: str | None = None,
row: int | None = None,
position: int | None = None,
width: int = 1,
disabled: bool = False,
autodefer: (
bool | AutodeferOptions | hikari.UndefinedType
) = hikari.UNDEFINED
)
Bases: InteractiveViewItem
, NavItem
An abstract base for all interactive navigation items.
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.
type
abstractmethod
property
#
type: hikari.ComponentType
The component's underlying component type.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
Indicates whether the item should be deferred automatically.
If left as UNDEFINED
, the view's autodefer option will be used.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|
NavLinkButton
#
NavLinkButton(
url: str,
label: str | None = None,
*,
emoji: hikari.Emoji | str | None = None,
disabled: bool = False,
row: int | None = None,
position: int | None = None
)
Bases: LinkButton
, NavItem
A base class for all navigation link buttons.
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.
label
property
writable
#
label: str | None
The button's label. This is the text visible on the button.
emoji
property
writable
#
The emoji that should be visible on the button.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
NavButton
#
NavButton(
label: str | None = None,
*,
emoji: hikari.Emoji | str | None = None,
style: InteractiveButtonStylesT = hikari.ButtonStyle.PRIMARY,
disabled: bool = False,
custom_id: str | None = None,
row: int | None = None,
position: int | None = None,
autodefer: (
bool | AutodeferOptions | hikari.UndefinedType
) = hikari.UNDEFINED
)
Bases: Button
, InteractiveNavItem
A base class for all navigation buttons.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
Indicates whether the item should be deferred automatically.
If left as UNDEFINED
, the view's autodefer option will be used.
label
property
writable
#
label: str | None
The button's label. This is the text visible on the button.
emoji
property
writable
#
The emoji that should be visible on the button.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|
NavTextSelect
#
NavTextSelect(
*,
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: TextSelect
, InteractiveNavItem
A base class for all navigation text selects.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
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.
max_values
property
writable
#
max_values: int
The maximum amount of options a user is allowed to select.
options
property
writable
#
options: t.Sequence[hikari.SelectMenuOption | SelectOption]
The select menu's options.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|
NavUserSelect
#
NavUserSelect(
*,
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: UserSelect
, InteractiveNavItem
A base class for all navigation user selects.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
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.
max_values
property
writable
#
max_values: int
The maximum amount of options a user is allowed to select.
values
property
#
The currently selected user objects.
Some users may also be instances of hikari.InteractionMember
, depending on how they were resolved.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|
NavRoleSelect
#
NavRoleSelect(
*,
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: RoleSelect
, InteractiveNavItem
A base class for all navigation role selects.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
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.
max_values
property
writable
#
max_values: int
The maximum amount of options a user is allowed to select.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|
NavChannelSelect
#
NavChannelSelect(
*,
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: ChannelSelect
, InteractiveNavItem
A base class for all navigation channel selects.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
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.
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.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|
NavMentionableSelect
#
NavMentionableSelect(
*,
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: MentionableSelect
, InteractiveNavItem
A base class for all navigation mentionable selects.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
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.
max_values
property
writable
#
max_values: int
The maximum amount of options a user is allowed to select.
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 selectedvalues.roles
- All role objects selectedvalues.channels
- All channel objects selectedvalues.members
- All member objects selected
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|
NextButton
#
NextButton(
*,
style: InteractiveButtonStylesT = hikari.ButtonStyle.PRIMARY,
label: str | None = None,
custom_id: str | None = None,
emoji: hikari.Emoji | str | None = chr(9654),
row: int | None = None,
position: int | None = None
)
Bases: NavButton
A built-in NavButton to jump to the next page.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
Indicates whether the item should be deferred automatically.
If left as UNDEFINED
, the view's autodefer option will be used.
label
property
writable
#
label: str | None
The button's label. This is the text visible on the button.
emoji
property
writable
#
The emoji that should be visible on the button.
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:
|
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
PrevButton
#
PrevButton(
*,
style: InteractiveButtonStylesT = hikari.ButtonStyle.PRIMARY,
label: str | None = None,
custom_id: str | None = None,
emoji: hikari.Emoji | str | None = chr(9664),
row: int | None = None,
position: int | None = None
)
Bases: NavButton
A built-in NavButton to jump to previous page.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
Indicates whether the item should be deferred automatically.
If left as UNDEFINED
, the view's autodefer option will be used.
label
property
writable
#
label: str | None
The button's label. This is the text visible on the button.
emoji
property
writable
#
The emoji that should be visible on the button.
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:
|
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
FirstButton
#
FirstButton(
*,
style: InteractiveButtonStylesT = hikari.ButtonStyle.PRIMARY,
label: str | None = None,
custom_id: str | None = None,
emoji: hikari.Emoji | str | None = chr(9194),
row: int | None = None,
position: int | None = None
)
Bases: NavButton
A built-in NavButton to jump to first page.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
Indicates whether the item should be deferred automatically.
If left as UNDEFINED
, the view's autodefer option will be used.
label
property
writable
#
label: str | None
The button's label. This is the text visible on the button.
emoji
property
writable
#
The emoji that should be visible on the button.
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:
|
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
LastButton
#
LastButton(
*,
style: InteractiveButtonStylesT = hikari.ButtonStyle.PRIMARY,
label: str | None = None,
custom_id: str | None = None,
emoji: hikari.Emoji | str | None = chr(9193),
row: int | None = None,
position: int | None = None
)
Bases: NavButton
A built-in NavButton to jump to the last page.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
Indicates whether the item should be deferred automatically.
If left as UNDEFINED
, the view's autodefer option will be used.
label
property
writable
#
label: str | None
The button's label. This is the text visible on the button.
emoji
property
writable
#
The emoji that should be visible on the button.
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:
|
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
IndicatorButton
#
IndicatorButton(
*,
style: InteractiveButtonStylesT = hikari.ButtonStyle.SECONDARY,
custom_id: str | None = None,
emoji: hikari.Emoji | str | None = None,
disabled: bool = False,
row: int | None = None,
position: int | None = None
)
Bases: NavButton
A built-in NavButton to show the current page's number.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
Indicates whether the item should be deferred automatically.
If left as UNDEFINED
, the view's autodefer option will be used.
label
property
writable
#
label: str | None
The button's label. This is the text visible on the button.
emoji
property
writable
#
The emoji that should be visible on the button.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|
StopButton
#
StopButton(
*,
style: InteractiveButtonStylesT = hikari.ButtonStyle.DANGER,
label: str | None = None,
custom_id: str | None = None,
emoji: hikari.Emoji | str | None = chr(9209),
row: int | None = None,
position: int | None = None
)
Bases: NavButton
A built-in NavButton to stop the navigator and disable all buttons.
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.
autodefer
property
#
autodefer: AutodeferOptions | hikari.UndefinedType
Indicates whether the item should be deferred automatically.
If left as UNDEFINED
, the view's autodefer option will be used.
label
property
writable
#
label: str | None
The button's label. This is the text visible on the button.
emoji
property
writable
#
The emoji that should be visible on the button.
before_page_change
async
#
Called when the navigator is about to transition to the next page. Also called when a builder is created out of the navigator this item is attached to.
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:
|