Skip to content

StringSelect

Represents a select menu with string options.

Kind: global class

ParamTypeDescription
[data]ObjectThe data for the select menu.

Sets the custom ID for the select menu.

Kind: instance method of StringSelect
Returns: StringSelect - - The updated StringSelect instance.

ParamTypeDescription
customIdstringThe custom ID for the select menu.

Sets the placeholder text for the select menu.

Kind: instance method of StringSelect
Returns: StringSelect - - The updated StringSelect instance.

ParamTypeDescription
placeholderstringThe placeholder text for the select menu.

Sets the minimum number of values that can be selected in the select menu.

Kind: instance method of StringSelect
Returns: StringSelect - - The updated StringSelect instance.

ParamTypeDescription
minValuenumberThe minimum number of values that can be selected.

Sets the maximum number of values that can be selected in the select menu.

Kind: instance method of StringSelect
Returns: StringSelect - - The updated StringSelect instance.

ParamTypeDescription
maxValuenumberThe maximum number of values that can be selected.

Sets whether the select menu is disabled.

Kind: instance method of StringSelect
Returns: StringSelect - - The updated StringSelect instance.

ParamTypeDescription
disabledbooleanWhether the select menu is disabled.

Sets the options for the select menu.

Kind: instance method of StringSelect
Returns: StringSelect - - The updated StringSelect instance.
Throws:

  • RangeError - If the options array has more than 25 items.
ParamTypeDefaultDescription
[options]Array.<Object>[]The options for the select menu.

Adds options to the select menu.

Kind: instance method of StringSelect
Returns: StringSelect - - The updated StringSelect instance.
Throws:

  • RangeError - If the options array has more items than can be added to the select menu.
  • RangeError - If no options are provided to add to the select menu.
ParamTypeDefaultDescription
[options]Array.<Object>[]The options to add to the select menu.

Returns the JSON representation of the select menu.

Kind: instance method of StringSelect
Returns: Object - - The JSON representation of the select menu.

StringSelect.transformOptions([options]) ⇒ Object

Section titled “StringSelect.transformOptions([options]) ⇒ Object”

Transforms an option object for a string select component into a simpler format.

Kind: static method of StringSelect
Returns: Object - - The transformed option object.
Throws:

  • RangeError - If the option object is missing the label or value properties, or if the default property is not a boolean.
ParamTypeDescription
[options]ObjectThe option object to transform.

StringSelect.transformEmoji(emoji) ⇒ Object

Section titled “StringSelect.transformEmoji(emoji) ⇒ Object”

Transforms an emoji object for a string select component into a simpler format.

Kind: static method of StringSelect
Returns: Object - - The transformed emoji object.

ParamTypeDescription
emojiObjectThe emoji object to transform.