Skip to content

StringSelect

StringSelect

Represents a select menu with string options.

Kind: global class

new StringSelect([data])

ParamTypeDescription
[data]ObjectThe data for the select menu.

stringSelect.setCustomId(customId) ⇒ StringSelect

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.

stringSelect.setPlaceholder(placeholder) ⇒ StringSelect

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.

stringSelect.setMinValues(minValue) ⇒ StringSelect

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.

stringSelect.setMaxValues(maxValue) ⇒ StringSelect

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.

stringSelect.setDisabled(disabled) ⇒ StringSelect

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.

stringSelect.setOptions([options]) ⇒ StringSelect

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.

stringSelect.addOptions([options]) ⇒ StringSelect

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.

stringSelect.toJSON() ⇒ Object

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

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

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.