sendAndAwait

suspend fun <T> sendAndAwait(locale: Locale, interaction: ModalParentInteractionBehavior, callback: suspend (ModalSubmitInteraction?) -> T): T

Convenience function to send this modal to the given interaction and await its completion, running the provided callback.

null will be provided to the callback if the modal times out before the user responds.

More specific convenience functions are available, such as sendAndDeferEphemeral and sendAndDeferPublic.


suspend fun <T, E : InteractionCreateEvent> sendAndAwait(context: EventContext<E>, callback: suspend (ModalSubmitInteraction?) -> T): T

Convenience function that calls the basic sendAndAwait function with parameters taken from the current event context.

null will be provided to the callback if the modal times out before the user responds.


suspend fun <T> sendAndAwait(context: ApplicationCommandContext, callback: suspend (ModalSubmitInteraction?) -> T): T

Convenience function that calls the basic sendAndAwait function with parameters taken from the current command context.

null will be provided to the callback if the modal times out before the user responds.


suspend fun <T> sendAndAwait(context: ComponentContext<*>, callback: suspend (ModalSubmitInteraction?) -> T): T

Convenience function that calls the basic sendAndAwait function with parameters taken from the current component context.

null will be provided to the callback if the modal times out before the user responds.