Skip to content

Response Builders#

MessageBuilder #

Bases: hikari.impl.InteractionMessageBuilder, Mapping[str, t.Any]

A builder that represents a message payload.

This adapter object can be used to create a message response in both REST and Gateway contexts. It should not be instantiated directly, it is created by special view types.

to_hikari_kwargs #

to_hikari_kwargs() -> dict[str, t.Any]

Convert this builder to kwargs that can be passed to a hikari interaction's 'create_initial_response'.

send_to_channel async #

send_to_channel(
    channel: hikari.SnowflakeishOr[hikari.TextableChannel],
) -> hikari.Message

Send this builder to a channel.

PARAMETER DESCRIPTION
channel

The channel to send this message to.

TYPE: hikari.TextableChannel

RETURNS DESCRIPTION
hikari.Message

The message that was sent.

RAISES DESCRIPTION
RuntimeError

This method was invoked on a builder that has no client assigned to it.

create_initial_response async #

create_initial_response(
    interaction: hikari.MessageResponseMixin[t.Any],
) -> None

Create an initial response from this builder. This only works in a Gateway context.

When using a REST bot, this object can be returned directly from the REST interaction callback.

PARAMETER DESCRIPTION
interaction

The interaction to respond to.

TYPE: hikari.MessageResponseMixin

RAISES DESCRIPTION
RuntimeError

This method was invoked on a builder that was created by a RESTClient.

create_followup async #

create_followup(
    interaction: hikari.MessageResponseMixin[t.Any],
) -> hikari.Message

Create a followup message from this builder. This works in both Gateway and REST contexts.

PARAMETER DESCRIPTION
interaction

The interaction to respond to.

TYPE: hikari.MessageResponseMixin

RETURNS DESCRIPTION
hikari.Message

The message that was sent or edited.

DeferredResponseBuilder #

DeferredResponseBuilder(
    type: t.Literal[
        hikari.ResponseType.DEFERRED_MESSAGE_CREATE,
        5,
        hikari.ResponseType.DEFERRED_MESSAGE_UPDATE,
        6,
    ],
    *,
    flags: (
        hikari.MessageFlag | hikari.UndefinedType
    ) = hikari.UNDEFINED
)

Bases: hikari.impl.InteractionDeferredBuilder, t.Mapping[str, t.Any]

A builder that represents a deferred response payload.

to_hikari_kwargs #

to_hikari_kwargs() -> dict[str, t.Any]

Convert this builder to kwargs that can be passed to a hikari interaction's create_initial_response.

create_initial_response async #

create_initial_response(
    interaction: hikari.MessageResponseMixin[t.Any],
) -> None

Create an initial response from this builder. This only works with a GatewayClient.

PARAMETER DESCRIPTION
interaction

The interaction to respond to.

TYPE: hikari.MessageResponseMixin

RAISES DESCRIPTION
RuntimeError

This method was invoked on a builder that was created by a RESTClient.

ModalBuilder #

ModalBuilder(
    title: str,
    custom_id: str,
    components: t.Sequence[hikari.api.ComponentBuilder],
)

Bases: hikari.impl.InteractionModalBuilder, t.Mapping[str, t.Any]

A builder that represents a modal payload. This can only be used as an initial response to an interaction.

This adapter object can be used to create a modal response in both REST and Gateway contexts. It should not be instantiated directly, it is created by modal objects.

to_hikari_kwargs #

to_hikari_kwargs() -> t.Mapping[str, t.Any]

Convert this builder to kwargs that can be passed to a hikari interaction's create_modal_response.

create_modal_response async #

create_modal_response(
    interaction: hikari.ModalResponseMixin,
) -> None

Create a modal response from this builder. This only works with a GatewayClient.

PARAMETER DESCRIPTION
interaction

The interaction to respond to.

TYPE: hikari.ModalInteraction

RAISES DESCRIPTION
RuntimeError

This method was invoked on a builder that was created by a RESTClient.