Component API Reference#

class flare.components.base.CallbackComponent(*args, **kwargs)[source]#

Bases: Component[MessageActionRowBuilder], SupportsCallback[MessageContext], SupportsCookie, Dataclass

An abstract class that all components with callbacks are derive from.

async static from_partial(component: PartialComponent) CallbackComponent[source]#

Build a flare component from hikari.PartialComponent.

Parameters:

component – A partial component. The component type must be hikari ComponentType.BUTTON or hikari.ComponentType.SELECT_MENU.

Returns:

A component.

Raises:

SerializerError – The component could not be deserialized.

get_from(rows: t.Sequence[row.Row]) t.Sequence[CallbackComponentT][source]#

Return all instances of this component that appear in typing.Sequence[flare.row.Row].

Parameters:

rows – The rows to search through.

Returns:

A list of all components of this type that appear in rows.

property cookie: str#

A unique identifier for a component.

property custom_id: str#

The custom ID of the component.

class flare.components.base.Component[source]#

Bases: ABC, Generic[ComponentBuilderT]

abstract build(action_row: ComponentBuilderT) Any[source]#

Build and append a flare component to a hikari action row.

abstract property custom_id: str#

A custom_id for a component.

abstract property width: int#

The width of the component.

class flare.components.base.SupportsCookie[source]#

Bases: ABC

abstract property cookie: str#

A unique identifier for a component.