Skip to content

NavItems API Reference#

NavItem #

NavItem(
    *,
    custom_id: str | None = None,
    row: int | None = None,
    position: int | None = None,
    disabled: bool = False,
    width: int = 1
)

Bases: ViewItem, abc.ABC

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.

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.

disabled property writable #

disabled: bool

Indicates whether the item is disabled or not.

view property #

The view this item is attached to.

before_page_change async #

before_page_change() -> None

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.

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 #

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.

before_page_change async #

before_page_change() -> None

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: ViewContextT

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

The view this item is attached to.

disabled property writable #

disabled: bool

Indicates whether the item is disabled or not.

label property writable #

label: str | None

The button's label. This is the text visible on the button.

style property #

style: t.Literal[hikari.ButtonStyle.LINK]

The button's style.

emoji property writable #

emoji: hikari.Emoji | None

The emoji that should be visible on the button.

url property writable #

url: str

The URL of the button.

before_page_change async #

before_page_change() -> None

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

label property writable #

label: str | None

The button's label. This is the text visible on the button.

style property writable #

The button's style.

emoji property writable #

emoji: hikari.Emoji | None

The emoji that should be visible on the button.

before_page_change async #

before_page_change() -> None

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: ViewContextT

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

options property writable #

The select menu's options.

before_page_change async #

before_page_change() -> None

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: ViewContextT

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

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.

before_page_change async #

before_page_change() -> None

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: ViewContextT

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

values property #

values: t.Sequence[hikari.Role]

The currently selected user objects.

before_page_change async #

before_page_change() -> None

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: ViewContextT

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

values property #

The currently selected channels.

before_page_change async #

before_page_change() -> None

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: ViewContextT

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

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

before_page_change async #

before_page_change() -> None

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: ViewContextT

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

label property writable #

label: str | None

The button's label. This is the text visible on the button.

style property writable #

The button's style.

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: ViewContextT

before_page_change async #

before_page_change() -> None

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

label property writable #

label: str | None

The button's label. This is the text visible on the button.

style property writable #

The button's style.

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: ViewContextT

before_page_change async #

before_page_change() -> None

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

label property writable #

label: str | None

The button's label. This is the text visible on the button.

style property writable #

The button's style.

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: ViewContextT

before_page_change async #

before_page_change() -> None

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

label property writable #

label: str | None

The button's label. This is the text visible on the button.

style property writable #

The button's style.

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: ViewContextT

before_page_change async #

before_page_change() -> None

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

label property writable #

label: str | None

The button's label. This is the text visible on the button.

style property writable #

The button's style.

emoji property writable #

emoji: hikari.Emoji | None

The emoji that should be visible on the button.

before_page_change async #

before_page_change() -> None

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: ViewContextT

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.

width property #

width: int

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

type property #

The component's underlying component type.

view property #

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.

label property writable #

label: str | None

The button's label. This is the text visible on the button.

style property writable #

The button's style.

emoji property writable #

emoji: hikari.Emoji | None

The emoji that should be visible on the button.

before_page_change async #

before_page_change() -> None

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: ViewContextT