SelectMenuOptionBuilder class
constructor
The SelectMenuOptionBuilder class provides one optional argument which is an object which provides the data for the SelectMenuOptionBuilder class.
The object may contain the following information:
label
: The text which should be visible to the member on the option. The string must be between 1-100 characters.value
: A string which will be returned to the bot once the member selects this option. The string must be between 1-100 characters.description
: A description for the option so the member understands what your meanings are when the member selects this option. The string must be between 1-100 characters.emoji
: An object which defines the emoji which should be on the option, if you want an emoji on the option. The object should provide whether the emoji is animated or not, the id of the emoji and the name of the emoji.default
: A boolean which defines whether the option should be the default option or not.
Properties
data
An object which makes it a valid object for the Discord API.
Functions
setValue
Sets a value for the option which will be returned to the bot once the option was selected and makes you able to recognize which option was selected by the member. The function returns the same SelectMenuOptionBuilder class so you don't have to declare it everytime again.
Argument | Description |
---|---|
value | A string of max 100 characters which will be returned to the bot in the menuSelect event so you can recognize the option which was selected by the member. |
setCustomId
Identical to the setValue function. Sets a value for the option which will be returned to the bot once the option was selected and makes you able to recognize which option was selected by the member. The function returns the same SelectMenuOptionBuilder class so you don't have to declare it everytime again.
Argument | Description |
---|---|
value | A string of max 100 characters which will be returned to the bot in the menuSelect event so you can recognize the option which was selected by the member. |
setLabel
Sets a label for the option which is visible to server members. The function returns the same SelectMenuBuilder class so you don't have to declare it everytime again.
Argument | Description |
---|---|
label | A string of max 100 characters which should be the text on the option. |
setText
Identical to the setLabel function. Sets a label for the option which is visible to server members. The function returns the same SelectMenuBuilder class so you don't have to declare it everytime again.
Argument | Description |
---|---|
text | A string of max 100 characters which should be the text on the option. |
setEmoji
Adds an emoji to the option. The emoji must be a unicode emoji or an instance of the Emoji class. The function returns the same SelectMenuOptionBuilder class so you don't have to declare it everytime again.
Argument | Description |
---|---|
emoji | The emoji which should be added to the option. The emoji must be a unicode emoji or an instance of the Emoji class. |
setDefault
Defines whether the option should be the default option to select or not. The function returns the same SelectMenuOptionBuilder class so you don't have to declare it everytime again.
Argument | Description |
---|---|
defaultOption | A boolean which defines whether the option should be the default option to select or not. |
setDescription
Sets a description for the option which is visible to the member and can help the member understand what the option does when the member selects it. The function returns the same SelectMenuOptionBuilder class so you don't have to declare it everytime again.
Argument | Description |
---|---|
description | The description for the option which can help the member understand what the option does when the member selects it. The descripition may max be 100 characters. |
toJSON
Converts the SelectMenuOptionBuilder class to an object to make it a valid object for the Discord API. The function returns the same data as the data property.
Last updated