SlashOption
SlashOption ⇐ Base
Represents a slash command option.
Kind: global class
Extends: Base
Properties
Name | Type | Description |
---|---|---|
type | string | The type of the option. |
name | string | The name of the option. |
description | string | The description of the option. |
required | boolean | Whether the option is required or not. |
choices | Array.<Object> | The choices available for the option. |
channelTypes | Array.<string> | The types of channels the option can be used in. |
minValue | number |
- SlashOption ⇐
Base
- new SlashOption([data], client)
- .transformChoices(o) ⇒
Object
- .transformChannelTypes(channel) ⇒
string
|object
new SlashOption([data], client)
Constructs a new instance of the SlashOption class.
Param | Type | Description |
---|---|---|
[data] | Object | The data object containing the option properties. |
client | Client | The client object. |
SlashOption.transformChoices(o) ⇒ Object
Transforms an object into a new object with the properties “name” and “value”. If the original object does not have a “name” or “value” property, the corresponding property in the new object will be set to undefined.
Kind: static method of SlashOption
Returns: Object
- - The transformed object with “name” and “value” properties.
Param | Type | Description |
---|---|---|
o | Object | The original object to transform. |
SlashOption.transformChannelTypes(channel) ⇒ string
| object
Transforms the channel type from a number to its corresponding string representation.
Kind: static method of SlashOption
Returns: string
| object
- - The transformed channel type.
Param | Type | Description |
---|---|---|
channel | number | object | The channel type to transform. If it is a number, it will be converted to its string representation. If it is an object, it will be returned as is. |