Item ABCs API Reference#
Item
#
Item(
*,
custom_id: str | None = None,
row: int | None = None,
position: int | None = None,
width: int = 1
)
Bases: abc.ABC
, t.Generic[BuilderT, ContextT, HandlerT]
An abstract base class for all components. Cannot be directly instantiated.
position
property
writable
#
position: int | None
The position of the item within the row it occupies.
row
property
writable
#
row: int | None
The row the item should occupy. Leave as None for automatic placement.
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.
ViewItem
#
ViewItem(
*,
custom_id: str | None = None,
row: int | None = None,
position: int | None = None,
width: int = 1,
disabled: bool = False
)
Bases: Item['hikari.impl.MessageActionRowBuilder', 'ViewContext', 'View']
, abc.ABC
An abstract base class for view components. Cannot be directly instantiated.
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.
InteractiveViewItem
#
InteractiveViewItem(
*,
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
)
An abstract base class for view components that have callbacks. Cannot be directly instantiated.
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.
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:
|
ModalItem
#
ModalItem(
*,
custom_id: str | None = None,
row: int | None = None,
position: int | None = None,
width: int = 1,
required: bool = False
)
Bases: Item['hikari.impl.ModalActionRowBuilder', 'ModalContext', 'Modal']
, abc.ABC
An abstract base class for modal components. Cannot be directly instantiated.
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.
DecoratedItem
#
DecoratedItem(
item_type: type[ViewItemT],
callback: t.Callable[
[ViewT, ViewContext, ViewItemT],
t.Coroutine[t.Any, t.Any, None],
],
**kwargs: t.Any
)