Class Modal

Represents a modal component

Constructors

Properties

Constructors

  • Creates a new modal component

    Parameters

    • name: string

      The name of the modal

    • data: ModalData

      The data of the modal (builder or raw)

    Returns Modal

    Example

    module.exports.default = new Modal('number_input', {
    customId: 'number_input',
    title: 'Number Input',
    components: [
    {
    type: ComponentType.ActionRow,
    components: [
    {
    customId: 'number',
    type: ComponentType.TextInput,
    style: TextInputStyle.Short,
    placeholder: 'Enter a number',
    label: 'Number',
    required: true
    }
    ]
    }
    ]
    });

    Example

    module.exports.default = new Modal(
    'number_input',
    new ModalBuilder()
    .setCustomId('number_input')
    .setTitle('Number Input')
    .setComponents(
    new ActionRowBuilder()
    .setComponents(
    new TextInputBuilder()
    .setCustomId('number')
    .setStyle(TextInputStyle.Short)
    .setPlaceholder('Enter a number')
    .setLabel('Number')
    .setRequired(true)
    )
    )
    );

Properties

data: ModalData

The data of the modal (builder or raw)

name: string

The name of the modal

Generated using TypeDoc