Class SelectMenu

Represents a select menu component

Constructors

Properties

Constructors

  • Creates a new select menu component

    Parameters

    • name: string

      The name of the select menu

    • data: SelectMenuData

      The data of the select menu (builder or raw)

    Returns SelectMenu

    Example

    module.exports.default = new SelectMenu('fruits', {
    type: ComponentType.StringSelect,
    customId: 'fruits',
    placeholder: 'Select a fruit',
    options: [
    {
    label: 'Apple',
    emoji: '🍎',
    value: 'apple'
    },
    {
    label: 'Banana',
    emoji: '🍌',
    value: 'banana'
    },
    {
    label: 'Orange',
    emoji: '🍊',
    value: 'orange'
    },
    {
    label: 'Strawberry',
    emoji: '🍓',
    value: 'strawberry'
    }
    ]
    });

    Example

    module.exports.default = new SelectMenu(
    'fruits',
    new StringSelectMenuBuilder()
    .setCustomId('fruits')
    .setPlaceholder('Select a fruit')
    .setOptions([
    {
    label: 'Apple',
    emoji: '🍎',
    value: 'apple'
    },
    {
    label: 'Banana',
    emoji: '🍌',
    value: 'banana'
    },
    {
    label: 'Orange',
    emoji: '🍊',
    value: 'orange'
    },
    {
    label: 'Strawberry',
    emoji: '🍓',
    value: 'strawberry'
    }
    ])
    );

Properties

The data of the select menu (builder or raw)

name: string

The name of the select menu

Generated using TypeDoc