Skip to content

ModalHandler

Defined in: handlers/ModalHandler.ts:8

Handler for modal submits based on custom ID prefix

Context extends BaseInteractionContext = BaseInteractionContext

new ModalHandler<Context>(prefix, handler?): ModalHandler<Context>

Defined in: handlers/ModalHandler.ts:17

string

The custom ID prefix this handler matches against. See the Custom ID System guide.

(interaction) => any

Optional handler function, equivalent to calling addHandler afterwards

ModalHandler<Context>

readonly handlerType: "modal" = "modal"

Defined in: handlers/ModalHandler.ts:9


readonly prefix: string

Defined in: handlers/ModalHandler.ts:10

addHandler(handler): ModalHandler<Context>

Defined in: handlers/ModalHandler.ts:32

Adds the modal handler function.

(interaction) => any

The function to handle the modal submit interaction

ModalHandler<Context>

The current ModalHandler instance


execute(interaction): Promise<void>

Defined in: handlers/ModalHandler.ts:40

Executes the modal handler

ModalInteraction<Context>

Promise<void>


matches(customId): boolean

Defined in: handlers/ModalHandler.ts:50

Checks if this handler matches the given custom ID

string

boolean