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.
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.
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.
NavTextSelect
#
NavTextSelect(
*,
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: TextSelect
, InteractiveNavItem
A base class for all navigation text selects.
NavUserSelect
#
NavUserSelect(
*,
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: UserSelect
, InteractiveNavItem
A base class for all navigation user selects.
NavRoleSelect
#
NavRoleSelect(
*,
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: RoleSelect
, InteractiveNavItem
A base class for all navigation role selects.
NavChannelSelect
#
NavChannelSelect(
*,
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: ChannelSelect
, InteractiveNavItem
A base class for all navigation channel selects.
NavMentionableSelect
#
NavMentionableSelect(
*,
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: MentionableSelect
, InteractiveNavItem
A base class for all navigation mentionable selects.
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
#
emoji: hikari.Emoji | None
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
#
emoji: hikari.Emoji | None
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
#
emoji: hikari.Emoji | None
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
#
emoji: hikari.Emoji | None
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
#
emoji: hikari.Emoji | None
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
#
emoji: hikari.Emoji | None
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:
|