Skip to content

UserSelect

UserSelect

Represents a user select component in a Discord interaction.

Kind: global class

new UserSelect([data])

Creates a new instance of UserSelect.

ParamTypeDescription
[data]ObjectThe data to create the UserSelect instance.
[data.custom_id]stringThe custom ID of the user select.
[data.options]Array.<Object>The options for the user select.
[data.options.label]stringThe label for the option.
[data.options.value]stringThe value for the option.
[data.options.description]stringThe description for the option.
[data.options.emoji]string | ObjectThe emoji for the option.
[data.options.emoji.name]stringThe name of the emoji.
[data.options.emoji.id]stringThe ID of the emoji.
[data.options.emoji.animated]booleanWhether the emoji is animated.
[data.options.default]booleanWhether the option is the default one.
[data.placeholder]stringThe placeholder text for the user select.
[data.min_values]numberThe minimum number of values that can be selected.
[data.max_values]numberThe maximum number of values that can be selected.
[data.disabled]booleanWhether the user select is disabled.

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.

ParamTypeDescription
customIdstringThe custom ID to set.

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.

ParamTypeDescription
placeholderstringThe placeholder text to set.

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.

ParamTypeDescription
minValuenumberThe minimum number of values to set.

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.

ParamTypeDescription
maxValuenumberThe maximum number of values to set.

userSelect.setDisabled(disabled) ⇒ UserSelect

Sets whether the user select component is disabled.

Kind: instance method of UserSelect
Returns: UserSelect - - The updated user select component.

ParamTypeDescription
disabledbooleanWhether the user select component is disabled.

userSelect.setOptions(options) ⇒ UserSelect

Sets the options for the user select component.

Kind: instance method of UserSelect
Returns: UserSelect - - The updated user select component.

ParamTypeDescription
optionsArray.<Object>An array of option objects to set.

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

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

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

ParamTypeDescription
[options]ObjectThe option object to transform.

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.

ParamTypeDescription
emojiObject | stringThe Discord emoji object or string to transform.