ChannelSelect
ChannelSelect
Class representing a Channel Select component for Discord message components.
Kind: global class
- ChannelSelect
- new ChannelSelect(data)
- instance
- static
- .transformOptions(options) ⇒
Object
- .transformEmoji(emoji) ⇒
Object
- .transformOptions(options) ⇒
new ChannelSelect(data)
Creates a new instance of the ChannelSelect class.
Param | Type | Description |
---|---|---|
data | Object | The data to initialize the channel select component with. |
data.custom_id | string | The unique identifier for the component. |
data.options | Array | The options for the select component. |
data.options.label | Object | The label for the option. |
data.options.value | Object | The value for the option. |
data.options.description | Object | The description for the option. |
data.options.emoji | Object | The emoji for the option. |
data.options.default | boolean | Whether the option is the default option. |
data.placeholder | string | The placeholder text for the select component. |
data.min_values | number | The minimum number of options that can be selected. |
data.max_values | number | The maximum number of options that can be selected. |
data.disabled | boolean | Whether the component is disabled. |
channelSelect.setCustomId(customId) ⇒ ChannelSelect
Sets the custom ID of the select component.
Kind: instance method of ChannelSelect
Returns: ChannelSelect
- The ChannelSelect instance.
Param | Type | Description |
---|---|---|
customId | string | The custom ID to set. |
channelSelect.setPlaceholder(placeholder) ⇒ ChannelSelect
Sets the placeholder text of the select component.
Kind: instance method of ChannelSelect
Returns: ChannelSelect
- The ChannelSelect instance.
Param | Type | Description |
---|---|---|
placeholder | string | The placeholder text to set. |
channelSelect.setMinValues(minValue) ⇒ ChannelSelect
Set the minimum number of options that can be selected.
Kind: instance method of ChannelSelect
Returns: ChannelSelect
- The ChannelSelect instance.
Param | Type | Description |
---|---|---|
minValue | number | The minimum number of options that can be selected. |
channelSelect.setMaxValues(maxValue) ⇒ ChannelSelect
Set the maximum number of options that can be selected.
Kind: instance method of ChannelSelect
Returns: ChannelSelect
- The ChannelSelect instance.
Param | Type | Description |
---|---|---|
maxValue | number | The maximum number of options that can be selected. |
channelSelect.setDisabled(maxValue) ⇒ ChannelSelect
Set the maximum number of options that can be selected.
Kind: instance method of ChannelSelect
Returns: ChannelSelect
- The ChannelSelect instance.
Param | Type | Description |
---|---|---|
maxValue | number | The maximum number of options that can be selected. |
channelSelect.setOptions(options) ⇒ ChannelSelect
Set the options for the select menu.
Kind: instance method of ChannelSelect
Returns: ChannelSelect
- The ChannelSelect instance.
Param | Type | Description |
---|---|---|
options | Array.<Object> | An array of option objects for the select menu. |
channelSelect.toJSON() ⇒ Object
Convert the ChannelSelect instance to a plain object for sending to Discord API.
Kind: instance method of ChannelSelect
Returns: Object
- The plain object representation of the ChannelSelect.
ChannelSelect.transformOptions(options) ⇒ Object
Transforms the given options data into a format compatible with the select component.
Kind: static method of ChannelSelect
Returns: Object
- The transformed options data.
Param | Type | Description |
---|---|---|
options | Object | The options data to transform. |
options.label | string | The label for the option. |
options.value | string | The value for the option. |
options.description | string | The description for the option. |
options.emoji | string | The emoji for the option. |
options.default | boolean | Whether the option is the default option. |
ChannelSelect.transformEmoji(emoji) ⇒ Object
Transforms the given emoji data into a format compatible with the select component.
Kind: static method of ChannelSelect
Returns: Object
- The transformed emoji data.
Param | Type | Description |
---|---|---|
emoji | Object | string | The emoji data to transform. |
emoji.name | string | The name of the emoji. |
emoji.id | string | The ID of the emoji. |
emoji.animated | boolean | Whether the emoji is animated. |