Skip to content
Functiongatewayv0.7.5

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 failed prompt send throws into the fault boundary. A ModalHandler is excluded at compile time.

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.