Skip to content
Functiongatewayv0.9.0

getConfirmation

Shows a confirm/cancel prompt with built-in Confirm and Cancel buttons and resolves to true only if the invoking user clicks confirm. A cancel click or a timeout resolves to false. Gate the action behind it with an early return. A ModalHandler is excluded at compile time.

Throws:

  • The send error when the prompt fails to send. The handler's fault boundary catches it.

async getConfirmation(
    handler: RepliableHandler<NonModalInteraction>,
    prompt: string,
    options?: DefaultConfirmOptions
): Promise<boolean>

prompt

prompt: string

The message shown above the Confirm and Cancel buttons.

options?

Ephemeral flag, timeout, the built-in buttons' labels and style, and the optional onConfirm/onCancel/onTimeout outcome replies that edit the prompt in place.