MentionableSelectMenuBuilder

export declare class MentionableSelectMenuBuilder extends BaseSelectMenuBuilder<APIMentionableSelectComponent>
export declare class MentionableSelectMenuBuilder extends BaseSelectMenuBuilder<APIMentionableSelectComponent>
A builder that creates API-compatible JSON data for mentionable select menus.
constructor(data?)
Creates a new select menu from API data.
Example
Creating a select menu from an API data object:
const selectMenu = new MentionableSelectMenuBuilder({
custom_id: 'a cool select menu',
placeholder: 'select an option',
max_values: 2,
});
const selectMenu = new MentionableSelectMenuBuilder({
custom_id: 'a cool select menu',
placeholder: 'select an option',
max_values: 2,
});
Example
Creating a select menu using setters and API data:
const selectMenu = new MentionableSelectMenuBuilder({
custom_id: 'a cool select menu',
})
.setMinValues(1);
const selectMenu = new MentionableSelectMenuBuilder({
custom_id: 'a cool select menu',
})
.setMinValues(1);
NameTypeOptionalDescription
dataPartial<APIMentionableSelectComponent>YesThe API data to create this select menu with
ProtectedReadonly
addDefaultRoles(...roles):this
Adds default roles to this auto populated select menu.
NameTypeOptionalDescription
...rolesRestOrArray<Snowflake>NoThe roles to add
addDefaultUsers(...users):this
Adds default users to this auto populated select menu.
NameTypeOptionalDescription
...usersRestOrArray<Snowflake>NoThe users to add
addDefaultValues(...values):this
Adds default values to this auto populated select menu.
clearPlaceholder():this
Clears the placeholder for this select menu.
Inherited from BaseSelectMenuBuilder
setCustomId(customId):this
Sets the custom id for this select menu.
NameTypeOptionalDescription
customIdstringNoThe custom id to use
Inherited from BaseSelectMenuBuilder
setDefaultValues(...values):this
Sets default values for this auto populated select menu.
setDisabled(disabled?):this
Sets whether this select menu is disabled.
NameTypeOptionalDescription
disabledbooleanYesWhether this select menu is disabled
Inherited from BaseSelectMenuBuilder
setMaxValues(maxValues):this
Sets the maximum values that must be selected in the select menu.
NameTypeOptionalDescription
maxValuesnumberNoThe maximum values that must be selected
Inherited from BaseSelectMenuBuilder
setMinValues(minValues):this
Sets the minimum values that must be selected in the select menu.
NameTypeOptionalDescription
minValuesnumberNoThe minimum values that must be selected
Inherited from BaseSelectMenuBuilder
setPlaceholder(placeholder):this
Sets the placeholder for this select menu.
NameTypeOptionalDescription
placeholderstringNoThe placeholder to use
Inherited from BaseSelectMenuBuilder
toJSON(validationOverride?):APIMentionableSelectComponent
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
NameTypeOptionalDescription
validationOverridebooleanYesForce validation to run/not run regardless of your global preference