UserSelect
Represents a user select component in a Discord interaction.
Kind: global class
- UserSelect
- new UserSelect([data])
- instance
- static
- .transformOptions([options]) ⇒
Object - .transformEmoji(emoji) ⇒
Object
- .transformOptions([options]) ⇒
new UserSelect([data])
Section titled “new UserSelect([data])”Creates a new instance of UserSelect.
| Param | Type | Description |
|---|---|---|
| [data] | Object | The data to create the UserSelect instance. |
| [data.custom_id] | string | The custom ID of the user select. |
| [data.options] | Array.<Object> | The options for the user select. |
| [data.options.label] | string | The label for the option. |
| [data.options.value] | string | The value for the option. |
| [data.options.description] | string | The description for the option. |
| [data.options.emoji] | string | Object | The emoji for the option. |
| [data.options.emoji.name] | string | The name of the emoji. |
| [data.options.emoji.id] | string | The ID of the emoji. |
| [data.options.emoji.animated] | boolean | Whether the emoji is animated. |
| [data.options.default] | boolean | Whether the option is the default one. |
| [data.placeholder] | string | The placeholder text for the user select. |
| [data.min_values] | number | The minimum number of values that can be selected. |
| [data.max_values] | number | The maximum number of values that can be selected. |
| [data.disabled] | boolean | Whether the user select is disabled. |
userSelect.setCustomId(customId) ⇒ UserSelect
Section titled “userSelect.setCustomId(customId) ⇒ UserSelect”Sets the custom ID for the user select component.
Kind: instance method of UserSelect
Returns: UserSelect - - The updated user select component.
| Param | Type | Description |
|---|---|---|
| customId | string | The custom ID to set. |
userSelect.setPlaceholder(placeholder) ⇒ UserSelect
Section titled “userSelect.setPlaceholder(placeholder) ⇒ UserSelect”Sets the placeholder text for the user select component.
Kind: instance method of UserSelect
Returns: UserSelect - - The updated user select component.
| Param | Type | Description |
|---|---|---|
| placeholder | string | The placeholder text to set. |
userSelect.setMinValues(minValue) ⇒ UserSelect
Section titled “userSelect.setMinValues(minValue) ⇒ UserSelect”Sets the minimum number of values that can be selected in the user select component.
Kind: instance method of UserSelect
Returns: UserSelect - - The updated user select component.
| Param | Type | Description |
|---|---|---|
| minValue | number | The minimum number of values to set. |
userSelect.setMaxValues(maxValue) ⇒ UserSelect
Section titled “userSelect.setMaxValues(maxValue) ⇒ UserSelect”Sets the maximum number of values that can be selected in the user select component.
Kind: instance method of UserSelect
Returns: UserSelect - - The updated user select component.
| Param | Type | Description |
|---|---|---|
| maxValue | number | The maximum number of values to set. |
userSelect.setDisabled(disabled) ⇒ UserSelect
Section titled “userSelect.setDisabled(disabled) ⇒ UserSelect”Sets whether the user select component is disabled.
Kind: instance method of UserSelect
Returns: UserSelect - - The updated user select component.
| Param | Type | Description |
|---|---|---|
| disabled | boolean | Whether the user select component is disabled. |
userSelect.setOptions(options) ⇒ UserSelect
Section titled “userSelect.setOptions(options) ⇒ UserSelect”Sets the options for the user select component.
Kind: instance method of UserSelect
Returns: UserSelect - - The updated user select component.
| Param | Type | Description |
|---|---|---|
| options | Array.<Object> | An array of option objects to set. |
userSelect.toJSON() ⇒ Object
Section titled “userSelect.toJSON() ⇒ Object”Converts the user select component to a plain object that can be sent in a Discord message.
Kind: instance method of UserSelect
Returns: Object - - The user select component as a plain object.
UserSelect.transformOptions([options]) ⇒ Object
Section titled “UserSelect.transformOptions([options]) ⇒ Object”Transforms an option object for a user select component into a simpler format.
Kind: static method of UserSelect
Returns: Object - - The transformed option object.
| Param | Type | Description |
|---|---|---|
| [options] | Object | The option object to transform. |
UserSelect.transformEmoji(emoji) ⇒ Object
Section titled “UserSelect.transformEmoji(emoji) ⇒ Object”Transforms a Discord emoji object or string into a simpler format.
Kind: static method of UserSelect
Returns: Object - - The transformed emoji object.
| Param | Type | Description |
|---|---|---|
| emoji | Object | string | The Discord emoji object or string to transform. |