seyfert
    Preparing search index...

    Class Modal<T>

    Represents a modal for user interactions.

    const modal = new Modal();
    modal.setTitle("Sample Modal");
    modal.addComponents(
    new ActionRow<TextInput>()
    .addComponents(new TextInput().setLabel("Enter text"))
    ));
    modal.run((interaction) => {
    // Handle modal submission
    });
    const json = modal.toJSON();

    Type Parameters

    Index

    Constructors

    Properties

    components: ActionRow<T>[] = []
    data: Partial<APIModalInteractionResponseCallbackData> = {}

    Optional data for the modal.

    Methods

    • Adds components to the modal.

      Parameters

      • ...components: RestOrArray<ActionRow<T>>

        Components to be added to the modal.

      Returns this

      The current Modal instance.

    • Set the components to the modal.

      Parameters

      • component: ActionRow<T>[]

        The components to set into the modal.

      Returns this

      The current Modal instance.

    • Sets the custom ID of the modal.

      Parameters

      • id: string

        The custom ID for the modal.

      Returns this

      The current Modal instance.

    • Sets the title of the modal.

      Parameters

      • title: string

        The title of the modal.

      Returns this

      The current Modal instance.

    • Converts the modal to JSON format.

      Returns APIModalInteractionResponseCallbackData

      The modal data in JSON format.