StringSelect
StringSelect
Represents a select menu with string options.
Kind: global class
- StringSelect
- new StringSelect([data])
- instance
- static
- .transformOptions([options]) ⇒
Object
- .transformEmoji(emoji) ⇒
Object
- .transformOptions([options]) ⇒
new StringSelect([data])
Param | Type | Description |
---|---|---|
[data] | Object | The 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.
Param | Type | Description |
---|---|---|
customId | string | The 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.
Param | Type | Description |
---|---|---|
placeholder | string | The 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.
Param | Type | Description |
---|---|---|
minValue | number | The 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.
Param | Type | Description |
---|---|---|
maxValue | number | The 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.
Param | Type | Description |
---|---|---|
disabled | boolean | Whether 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.
Param | Type | Default | Description |
---|---|---|---|
[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.
Param | Type | Default | Description |
---|---|---|---|
[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.
Param | Type | Description |
---|---|---|
[options] | Object | The 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.
Param | Type | Description |
---|---|---|
emoji | Object | The emoji object to transform. |