seyfert
    Preparing search index...

    Class Modal

    Represents a modal for user interactions.

    The type of components allowed in the modal.

    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();
    Index

    Constructors

    • Creates a new Modal instance.

      Parameters

      • data: Partial<APIModalInteractionResponseCallbackData> = {}

        Optional data for the modal.

      Returns Modal

    Properties

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

    Optional data for the modal.

    Methods

    • 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.