Skip to content

Context API Reference#

ModalContext #

ModalContext(
    modal: Modal,
    client: Client,
    interaction: hikari.ModalInteraction,
    values: t.Mapping[ModalItem, str],
)

Bases: Context[hikari.ModalInteraction]

A context object proxying a ModalInteraction received by a miru modal.

interaction property #

interaction: InteractionT

The underlying interaction object.

Warning

This should not be used directly in most cases, and is only exposed for advanced use cases.

If you use the interaction to create a response in a view, you should disable the autodefer feature in your View.

custom_id property #

custom_id: str

The developer provided unique identifier for the interaction this context is proxying.

responses property #

A list of all responses issued to the interaction this context is proxying.

client property #

client: Client

The client that loaded miru.

user property #

user: hikari.User

The user who triggered this interaction.

author property #

author: hikari.User

Alias for Context.user.

member property #

member: hikari.InteractionMember | None

The member who triggered this interaction. Will be None in DMs.

locale property #

locale: str | hikari.Locale

The locale of this context.

guild_locale property #

guild_locale: str | hikari.Locale | None

The guild locale of this context, if in a guild. This will default to en-US if not a community guild.

app_permissions property #

app_permissions: hikari.Permissions | None

The permissions of the bot. Will be None in DMs.

channel_id property #

channel_id: hikari.Snowflake

The ID of the channel the context represents.

guild_id property #

guild_id: hikari.Snowflake | None

The ID of the guild the context represents. Will be None in DMs.

is_valid property #

is_valid: bool

Returns if the underlying interaction expired or not. This is not 100% accurate due to API latency, but should be good enough for most use cases.

issued_response property #

issued_response: bool

Whether this interaction was already issued an initial response.

modal property #

modal: Modal

The modal this context originates from.

values property #

values: t.Mapping[ModalItem, str]

The values received as input for this modal.

get_guild #

get_guild() -> hikari.GatewayGuild | None

Gets the guild this context represents, if any. Requires application cache.

get_channel #

get_channel() -> hikari.TextableGuildChannel | None

Gets the channel this context represents, None if in a DM. Requires application cache.

get_last_response async #

get_last_response() -> InteractionResponse

Get the last response issued to the interaction this context is proxying.

RETURNS DESCRIPTION
InteractionResponse

The response object.

RAISES DESCRIPTION
RuntimeError

The interaction was not yet responded to.

respond async #

respond(
    content: hikari.UndefinedOr[t.Any] = hikari.UNDEFINED,
    *,
    flags: (
        int | hikari.MessageFlag | hikari.UndefinedType
    ) = hikari.UNDEFINED,
    tts: hikari.UndefinedOr[bool] = hikari.UNDEFINED,
    component: hikari.UndefinedOr[
        hikari.api.ComponentBuilder
    ] = hikari.UNDEFINED,
    components: hikari.UndefinedOr[
        t.Sequence[hikari.api.ComponentBuilder]
    ] = hikari.UNDEFINED,
    attachment: hikari.UndefinedOr[
        hikari.Resourceish
    ] = hikari.UNDEFINED,
    attachments: hikari.UndefinedOr[
        t.Sequence[hikari.Resourceish]
    ] = hikari.UNDEFINED,
    embed: hikari.UndefinedOr[
        hikari.Embed
    ] = hikari.UNDEFINED,
    embeds: hikari.UndefinedOr[
        t.Sequence[hikari.Embed]
    ] = hikari.UNDEFINED,
    mentions_everyone: hikari.UndefinedOr[
        bool
    ] = hikari.UNDEFINED,
    user_mentions: hikari.UndefinedOr[
        hikari.SnowflakeishSequence[hikari.PartialUser]
        | bool
    ] = hikari.UNDEFINED,
    role_mentions: hikari.UndefinedOr[
        hikari.SnowflakeishSequence[hikari.PartialRole]
        | bool
    ] = hikari.UNDEFINED,
    delete_after: hikari.UndefinedOr[
        float | int | datetime.timedelta
    ] = hikari.UNDEFINED
) -> InteractionResponse

Short-hand method to create a new message response via the interaction this context represents.

PARAMETER DESCRIPTION
content

The content of the message. Anything passed here will be cast to str.

TYPE: hikari.UndefinedOr[Any] DEFAULT: hikari.UNDEFINED

tts

If the message should be tts or not.

TYPE: hikari.UndefinedOr[bool] DEFAULT: hikari.UNDEFINED

attachment

An attachment to add to this message.

TYPE: hikari.UndefinedOr[hikari.Resourceish] DEFAULT: hikari.UNDEFINED

attachments

A sequence of attachments to add to this message.

TYPE: hikari.UndefinedOr[t.Sequence[hikari.Resourceish]] DEFAULT: hikari.UNDEFINED

component

A component to add to this message.

TYPE: hikari.UndefinedOr[hikari.api.special_endpoints.ComponentBuilder] DEFAULT: hikari.UNDEFINED

components

A sequence of components to add to this message.

TYPE: hikari.UndefinedOr[t.Sequence[hikari.api.special_endpoints.ComponentBuilder]] DEFAULT: hikari.UNDEFINED

embed

An embed to add to this message.

TYPE: hikari.UndefinedOr[hikari.Embed] DEFAULT: hikari.UNDEFINED

embeds

A sequence of embeds to add to this message.

TYPE: hikari.UndefinedOr[Sequence[hikari.Embed]] DEFAULT: hikari.UNDEFINED

mentions_everyone

If True, mentioning @everyone will be allowed.

TYPE: hikari.UndefinedOr[bool] DEFAULT: hikari.UNDEFINED

user_mentions

The set of allowed user mentions in this message. Set to True to allow all.

TYPE: hikari.UndefinedOr[Union[hikari.SnowflakeishSequence[hikari.PartialUser], bool]] DEFAULT: hikari.UNDEFINED

role_mentions

The set of allowed role mentions in this message. Set to True to allow all.

TYPE: hikari.UndefinedOr[Union[hikari.SnowflakeishSequence[hikari.PartialRole], bool]] DEFAULT: hikari.UNDEFINED

flags

Message flags that should be included with this message.

TYPE: Union[hikari.UndefinedType, int, hikari.MessageFlag] DEFAULT: hikari.UNDEFINED

delete_after

Delete the response after the specified delay.

TYPE: hikari.UndefinedOr[float | int | datetime.timedelta] DEFAULT: hikari.UNDEFINED

RETURNS DESCRIPTION
InteractionResponse

A proxy object representing the response to the interaction.

edit_response async #

edit_response(
    content: hikari.UndefinedNoneOr[
        t.Any
    ] = hikari.UNDEFINED,
    *,
    flags: (
        int | hikari.MessageFlag | hikari.UndefinedType
    ) = hikari.UNDEFINED,
    tts: hikari.UndefinedOr[bool] = hikari.UNDEFINED,
    component: hikari.UndefinedNoneOr[
        hikari.api.ComponentBuilder
    ] = hikari.UNDEFINED,
    components: hikari.UndefinedNoneOr[
        t.Sequence[hikari.api.ComponentBuilder]
    ] = hikari.UNDEFINED,
    attachment: hikari.UndefinedNoneOr[
        hikari.Resourceish
    ] = hikari.UNDEFINED,
    attachments: hikari.UndefinedNoneOr[
        t.Sequence[hikari.Resourceish]
    ] = hikari.UNDEFINED,
    embed: hikari.UndefinedNoneOr[
        hikari.Embed
    ] = hikari.UNDEFINED,
    embeds: hikari.UndefinedNoneOr[
        t.Sequence[hikari.Embed]
    ] = hikari.UNDEFINED,
    mentions_everyone: hikari.UndefinedOr[
        bool
    ] = hikari.UNDEFINED,
    user_mentions: hikari.UndefinedOr[
        hikari.SnowflakeishSequence[hikari.PartialUser]
        | bool
    ] = hikari.UNDEFINED,
    role_mentions: hikari.UndefinedOr[
        hikari.SnowflakeishSequence[hikari.PartialRole]
        | bool
    ] = hikari.UNDEFINED
) -> InteractionResponse

A short-hand method to edit the initial response belonging to this interaction. If no initial response was issued yet, this will create one of type MESSAGE_UPDATE. In the case of modals, this will be the component's message that triggered the modal.

PARAMETER DESCRIPTION
content

The content of the message. Anything passed here will be cast to str.

TYPE: hikari.UndefinedOr[Any] DEFAULT: hikari.UNDEFINED

tts

If the message should be tts or not.

TYPE: hikari.UndefinedOr[bool] DEFAULT: hikari.UNDEFINED

attachment

An attachment to add to this message.

TYPE: hikari.UndefinedOr[hikari.Resourceish] DEFAULT: hikari.UNDEFINED

attachments

A sequence of attachments to add to this message.

TYPE: hikari.UndefinedOr[t.Sequence[hikari.Resourceish]] DEFAULT: hikari.UNDEFINED

component

A component to add to this message.

TYPE: hikari.UndefinedOr[hikari.api.special_endpoints.ComponentBuilder] DEFAULT: hikari.UNDEFINED

components

A sequence of components to add to this message.

TYPE: hikari.UndefinedOr[t.Sequence[hikari.api.special_endpoints.ComponentBuilder]] DEFAULT: hikari.UNDEFINED

embed

An embed to add to this message.

TYPE: hikari.UndefinedOr[hikari.Embed] DEFAULT: hikari.UNDEFINED

embeds

A sequence of embeds to add to this message.

TYPE: hikari.UndefinedOr[Sequence[hikari.Embed]] DEFAULT: hikari.UNDEFINED

mentions_everyone

If True, mentioning @everyone will be allowed.

TYPE: hikari.UndefinedOr[bool] DEFAULT: hikari.UNDEFINED

user_mentions

The set of allowed user mentions in this message. Set to True to allow all.

TYPE: hikari.UndefinedOr[Union[hikari.SnowflakeishSequence[hikari.PartialUser], bool]] DEFAULT: hikari.UNDEFINED

role_mentions

The set of allowed role mentions in this message. Set to True to allow all.

TYPE: hikari.UndefinedOr[Union[hikari.SnowflakeishSequence[hikari.PartialRole], bool]] DEFAULT: hikari.UNDEFINED

flags

Message flags that should be included with this message.

TYPE: Union[hikari.UndefinedType, int, hikari.MessageFlag] DEFAULT: hikari.UNDEFINED

RETURNS DESCRIPTION
InteractionResponse

A proxy object representing the response to the interaction.

defer async #

defer(
    *args: t.Any,
    flags: hikari.UndefinedOr[
        int | hikari.MessageFlag
    ] = hikari.UNDEFINED,
    **kwargs: t.Any
) -> None

Short-hand method to defer an interaction response. Raises RuntimeError if the interaction was already responded to.

PARAMETER DESCRIPTION
response_type

The response-type of this defer action. Defaults to DEFERRED_MESSAGE_UPDATE.

TYPE: hikari.ResponseType

flags

Message flags that should be included with this defer request

TYPE: Union[int, hikari.MessageFlag, None] DEFAULT: hikari.UNDEFINED

RAISES DESCRIPTION
RuntimeError

The interaction was already responded to.

ValueError

response_type was not a deferred response type.

respond_with_builder async #

respond_with_builder(
    builder: ModalResponseBuildersT,
) -> InteractionResponse

Respond to the interaction with a builder. This method will try to turn the builder into a valid response or followup, depending on the builder type and interaction state.

PARAMETER DESCRIPTION
builder

The builder to respond with.

TYPE: ModalResponseBuildersT

RETURNS DESCRIPTION
InteractionResponse

The response that was sent.

RAISES DESCRIPTION
RuntimeError

The interaction was already responded to.

get_value_by #

get_value_by(
    predicate: t.Callable[[ModalItem], bool],
    *,
    default: T | hikari.UndefinedType = hikari.UNDEFINED
) -> str | T

Get the value for the first modal item that matches the given predicate.

PARAMETER DESCRIPTION
predicate

A predicate to match the item.

TYPE: Callable[[ModalItem], bool]

default

A default value to return if no item was matched

TYPE: T DEFAULT: hikari.UNDEFINED

RETURNS DESCRIPTION
T | str

The value of the item that matched the predicate or the default value.

RAISES DESCRIPTION
KeyError

The item was not found and no default was provided.

get_value_by_id #

get_value_by_id(
    custom_id: str,
    default: T | hikari.UndefinedType = hikari.UNDEFINED,
) -> T | str

Get the value for a modal item with the given custom ID.

PARAMETER DESCRIPTION
custom_id

The custom_id of the component.

TYPE: str

default

A default value to return if the item was not found

TYPE: T DEFAULT: hikari.UNDEFINED

RETURNS DESCRIPTION
T | str

The value of the item with the given custom ID or the default value.

RAISES DESCRIPTION
KeyError

The item was not found and no default was provided.

AutodeferMode #

Bases: enum.IntEnum

OFF class-attribute instance-attribute #

OFF = 0

Do not autodefer.

ON class-attribute instance-attribute #

ON = 1

Autodefer if the item takes longer than 2 seconds to respond.

EPHEMERAL class-attribute instance-attribute #

EPHEMERAL = 2

Autodefer and make the response ephemeral if the item takes longer than 2 seconds to respond.

should_autodefer property #

should_autodefer: bool

Whether this mode should autodefer.

AutodeferOptions #

AutodeferOptions(
    mode: AutodeferMode,
    response_type: (
        t.Literal[
            hikari.ResponseType.DEFERRED_MESSAGE_CREATE
        ]
        | t.Literal[
            hikari.ResponseType.DEFERRED_MESSAGE_UPDATE
        ]
    ),
)

mode property #

The autodefer mode.

response_type property #

response_type: hikari.ResponseType

The response type to use when autodefering.

ViewContext #

ViewContext(
    view: View,
    client: Client,
    interaction: hikari.ComponentInteraction,
)

Bases: Context[hikari.ComponentInteraction]

A context object proxying a ComponentInteraction for a view item.

interaction property #

interaction: InteractionT

The underlying interaction object.

Warning

This should not be used directly in most cases, and is only exposed for advanced use cases.

If you use the interaction to create a response in a view, you should disable the autodefer feature in your View.

custom_id property #

custom_id: str

The developer provided unique identifier for the interaction this context is proxying.

responses property #

A list of all responses issued to the interaction this context is proxying.

client property #

client: Client

The client that loaded miru.

user property #

user: hikari.User

The user who triggered this interaction.

author property #

author: hikari.User

Alias for Context.user.

member property #

member: hikari.InteractionMember | None

The member who triggered this interaction. Will be None in DMs.

locale property #

locale: str | hikari.Locale

The locale of this context.

guild_locale property #

guild_locale: str | hikari.Locale | None

The guild locale of this context, if in a guild. This will default to en-US if not a community guild.

app_permissions property #

app_permissions: hikari.Permissions | None

The permissions of the bot. Will be None in DMs.

channel_id property #

channel_id: hikari.Snowflake

The ID of the channel the context represents.

guild_id property #

guild_id: hikari.Snowflake | None

The ID of the guild the context represents. Will be None in DMs.

is_valid property #

is_valid: bool

Returns if the underlying interaction expired or not. This is not 100% accurate due to API latency, but should be good enough for most use cases.

issued_response property #

issued_response: bool

Whether this interaction was already issued an initial response.

view property #

view: View

The view this context originates from.

message property #

message: hikari.Message

The message object for the view this context is proxying.

get_guild #

get_guild() -> hikari.GatewayGuild | None

Gets the guild this context represents, if any. Requires application cache.

get_channel #

get_channel() -> hikari.TextableGuildChannel | None

Gets the channel this context represents, None if in a DM. Requires application cache.

get_last_response async #

get_last_response() -> InteractionResponse

Get the last response issued to the interaction this context is proxying.

RETURNS DESCRIPTION
InteractionResponse

The response object.

RAISES DESCRIPTION
RuntimeError

The interaction was not yet responded to.

respond async #

respond(
    content: hikari.UndefinedOr[t.Any] = hikari.UNDEFINED,
    *,
    flags: (
        int | hikari.MessageFlag | hikari.UndefinedType
    ) = hikari.UNDEFINED,
    tts: hikari.UndefinedOr[bool] = hikari.UNDEFINED,
    component: hikari.UndefinedOr[
        hikari.api.ComponentBuilder
    ] = hikari.UNDEFINED,
    components: hikari.UndefinedOr[
        t.Sequence[hikari.api.ComponentBuilder]
    ] = hikari.UNDEFINED,
    attachment: hikari.UndefinedOr[
        hikari.Resourceish
    ] = hikari.UNDEFINED,
    attachments: hikari.UndefinedOr[
        t.Sequence[hikari.Resourceish]
    ] = hikari.UNDEFINED,
    embed: hikari.UndefinedOr[
        hikari.Embed
    ] = hikari.UNDEFINED,
    embeds: hikari.UndefinedOr[
        t.Sequence[hikari.Embed]
    ] = hikari.UNDEFINED,
    mentions_everyone: hikari.UndefinedOr[
        bool
    ] = hikari.UNDEFINED,
    user_mentions: hikari.UndefinedOr[
        hikari.SnowflakeishSequence[hikari.PartialUser]
        | bool
    ] = hikari.UNDEFINED,
    role_mentions: hikari.UndefinedOr[
        hikari.SnowflakeishSequence[hikari.PartialRole]
        | bool
    ] = hikari.UNDEFINED,
    delete_after: hikari.UndefinedOr[
        float | int | datetime.timedelta
    ] = hikari.UNDEFINED
) -> InteractionResponse

Short-hand method to create a new message response via the interaction this context represents.

PARAMETER DESCRIPTION
content

The content of the message. Anything passed here will be cast to str.

TYPE: hikari.UndefinedOr[Any] DEFAULT: hikari.UNDEFINED

tts

If the message should be tts or not.

TYPE: hikari.UndefinedOr[bool] DEFAULT: hikari.UNDEFINED

attachment

An attachment to add to this message.

TYPE: hikari.UndefinedOr[hikari.Resourceish] DEFAULT: hikari.UNDEFINED

attachments

A sequence of attachments to add to this message.

TYPE: hikari.UndefinedOr[t.Sequence[hikari.Resourceish]] DEFAULT: hikari.UNDEFINED

component

A component to add to this message.

TYPE: hikari.UndefinedOr[hikari.api.special_endpoints.ComponentBuilder] DEFAULT: hikari.UNDEFINED

components

A sequence of components to add to this message.

TYPE: hikari.UndefinedOr[t.Sequence[hikari.api.special_endpoints.ComponentBuilder]] DEFAULT: hikari.UNDEFINED

embed

An embed to add to this message.

TYPE: hikari.UndefinedOr[hikari.Embed] DEFAULT: hikari.UNDEFINED

embeds

A sequence of embeds to add to this message.

TYPE: hikari.UndefinedOr[Sequence[hikari.Embed]] DEFAULT: hikari.UNDEFINED

mentions_everyone

If True, mentioning @everyone will be allowed.

TYPE: hikari.UndefinedOr[bool] DEFAULT: hikari.UNDEFINED

user_mentions

The set of allowed user mentions in this message. Set to True to allow all.

TYPE: hikari.UndefinedOr[Union[hikari.SnowflakeishSequence[hikari.PartialUser], bool]] DEFAULT: hikari.UNDEFINED

role_mentions

The set of allowed role mentions in this message. Set to True to allow all.

TYPE: hikari.UndefinedOr[Union[hikari.SnowflakeishSequence[hikari.PartialRole], bool]] DEFAULT: hikari.UNDEFINED

flags

Message flags that should be included with this message.

TYPE: Union[hikari.UndefinedType, int, hikari.MessageFlag] DEFAULT: hikari.UNDEFINED

delete_after

Delete the response after the specified delay.

TYPE: hikari.UndefinedOr[float | int | datetime.timedelta] DEFAULT: hikari.UNDEFINED

RETURNS DESCRIPTION
InteractionResponse

A proxy object representing the response to the interaction.

respond_with_builder async #

respond_with_builder(
    builder: ResponseBuildersT,
) -> InteractionResponse | None

Respond to the interaction with a builder. This method will try to turn the builder into a valid response or followup, depending on the builder type and interaction state.

PARAMETER DESCRIPTION
builder

The builder to respond with.

TYPE: ResponseBuilderT

RETURNS DESCRIPTION
InteractionResponse | None

A proxy object representing the response to the interaction. Will be None if the builder is a modal builder.

RAISES DESCRIPTION
RuntimeError

The interaction was already issued an initial response and the builder can only be used for initial responses.

edit_response async #

edit_response(
    content: hikari.UndefinedNoneOr[
        t.Any
    ] = hikari.UNDEFINED,
    *,
    flags: (
        int | hikari.MessageFlag | hikari.UndefinedType
    ) = hikari.UNDEFINED,
    tts: hikari.UndefinedOr[bool] = hikari.UNDEFINED,
    component: hikari.UndefinedNoneOr[
        hikari.api.ComponentBuilder
    ] = hikari.UNDEFINED,
    components: hikari.UndefinedNoneOr[
        t.Sequence[hikari.api.ComponentBuilder]
    ] = hikari.UNDEFINED,
    attachment: hikari.UndefinedNoneOr[
        hikari.Resourceish
    ] = hikari.UNDEFINED,
    attachments: hikari.UndefinedNoneOr[
        t.Sequence[hikari.Resourceish]
    ] = hikari.UNDEFINED,
    embed: hikari.UndefinedNoneOr[
        hikari.Embed
    ] = hikari.UNDEFINED,
    embeds: hikari.UndefinedNoneOr[
        t.Sequence[hikari.Embed]
    ] = hikari.UNDEFINED,
    mentions_everyone: hikari.UndefinedOr[
        bool
    ] = hikari.UNDEFINED,
    user_mentions: hikari.UndefinedOr[
        hikari.SnowflakeishSequence[hikari.PartialUser]
        | bool
    ] = hikari.UNDEFINED,
    role_mentions: hikari.UndefinedOr[
        hikari.SnowflakeishSequence[hikari.PartialRole]
        | bool
    ] = hikari.UNDEFINED
) -> InteractionResponse

A short-hand method to edit the initial response belonging to this interaction. If no initial response was issued yet, this will create one of type MESSAGE_UPDATE. In the case of modals, this will be the component's message that triggered the modal.

PARAMETER DESCRIPTION
content

The content of the message. Anything passed here will be cast to str.

TYPE: hikari.UndefinedOr[Any] DEFAULT: hikari.UNDEFINED

tts

If the message should be tts or not.

TYPE: hikari.UndefinedOr[bool] DEFAULT: hikari.UNDEFINED

attachment

An attachment to add to this message.

TYPE: hikari.UndefinedOr[hikari.Resourceish] DEFAULT: hikari.UNDEFINED

attachments

A sequence of attachments to add to this message.

TYPE: hikari.UndefinedOr[t.Sequence[hikari.Resourceish]] DEFAULT: hikari.UNDEFINED

component

A component to add to this message.

TYPE: hikari.UndefinedOr[hikari.api.special_endpoints.ComponentBuilder] DEFAULT: hikari.UNDEFINED

components

A sequence of components to add to this message.

TYPE: hikari.UndefinedOr[t.Sequence[hikari.api.special_endpoints.ComponentBuilder]] DEFAULT: hikari.UNDEFINED

embed

An embed to add to this message.

TYPE: hikari.UndefinedOr[hikari.Embed] DEFAULT: hikari.UNDEFINED

embeds

A sequence of embeds to add to this message.

TYPE: hikari.UndefinedOr[Sequence[hikari.Embed]] DEFAULT: hikari.UNDEFINED

mentions_everyone

If True, mentioning @everyone will be allowed.

TYPE: hikari.UndefinedOr[bool] DEFAULT: hikari.UNDEFINED

user_mentions

The set of allowed user mentions in this message. Set to True to allow all.

TYPE: hikari.UndefinedOr[Union[hikari.SnowflakeishSequence[hikari.PartialUser], bool]] DEFAULT: hikari.UNDEFINED

role_mentions

The set of allowed role mentions in this message. Set to True to allow all.

TYPE: hikari.UndefinedOr[Union[hikari.SnowflakeishSequence[hikari.PartialRole], bool]] DEFAULT: hikari.UNDEFINED

flags

Message flags that should be included with this message.

TYPE: Union[hikari.UndefinedType, int, hikari.MessageFlag] DEFAULT: hikari.UNDEFINED

RETURNS DESCRIPTION
InteractionResponse

A proxy object representing the response to the interaction.

defer async #

defer(
    *args: t.Any,
    flags: hikari.UndefinedOr[
        int | hikari.MessageFlag
    ] = hikari.UNDEFINED,
    **kwargs: t.Any
) -> None

Short-hand method to defer an interaction response. Raises RuntimeError if the interaction was already responded to.

PARAMETER DESCRIPTION
response_type

The response-type of this defer action. Defaults to DEFERRED_MESSAGE_UPDATE.

TYPE: hikari.ResponseType

flags

Message flags that should be included with this defer request

TYPE: Union[int, hikari.MessageFlag, None] DEFAULT: hikari.UNDEFINED

RAISES DESCRIPTION
RuntimeError

The interaction was already responded to.

ValueError

response_type was not a deferred response type.

respond_with_modal async #

respond_with_modal(modal: Modal) -> None

Respond to this interaction with a modal.

This is effectively the same as:

builder = modal.build_response(client)
await ctx.respond_with_builder(builder)
client.start_modal(modal)

PARAMETER DESCRIPTION
modal

The modal to respond with.

TYPE: Modal