Skip to content

MessageSelectMenu

classe · Source

Represents a select menu message component

Extends: BaseMessageComponent

Constructor

new MessageSelectMenu(data?: MessageSelectMenu | MessageSelectMenuOptions)

Parameters

NameTypeDescription
data?MessageSelectMenu | MessageSelectMenuOptionsMessageSelectMenu to clone or raw data Default: {}.

Properties

customId

nullable

customId: string

A unique string to be sent in the interaction when clicked Source

placeholder

nullable

placeholder: string

Custom placeholder text to display when nothing is selected Source

minValues

nullable

minValues: number

The minimum number of selections required Source

maxValues

nullable

maxValues: number

The maximum number of selections allowed Source

options

options: Array<MessageSelectOption>

Options for the STRING_SELECT menu Source

disabled

disabled: boolean

Whether this select menu is currently disabled Source

channelTypes

channelTypes: Array<ChannelType>

Channels that are possible to select in CHANNEL_SELECT menu Source

type

nullable

type: MessageComponentType

The type of this component Source

data

data: MessageComponentOptions

The data for this component Source

id

readonly

id: number

The id of this component Source

Methods

toJSON

toJSON(): APIMessageSelectMenu

Transforms the select menu into a plain object Returns: APIMessageSelectMenu — The raw data of this select menu Source

normalizeOption

static

normalizeOption(option: MessageSelectOptionData): MessageSelectOption

Normalizes option input and resolves strings and emojis. Parameters

NameTypeDescription
optionMessageSelectOptionDataThe select menu option to normalize

Returns: MessageSelectOptionSource

normalizeOptions

static

normalizeOptions(options: MessageSelectOptionData | Array<MessageSelectOptionData>): Array<MessageSelectOption>

Normalizes option input and resolves strings and emojis. Parameters

NameTypeDescription
optionsMessageSelectOptionData | Array<MessageSelectOptionData>The select menu options to normalize

Returns: Array<MessageSelectOption>Source

Unofficial software. Not affiliated with or supported by Discord.