Skip to main content
Version: Next

MentionableSelectMenuKit

MentionableSelectMenuKit extends MentionableSelectMenuBuilder

new MentionableSelectMenuKit(data)
ParameterTypeOptional
dataPartial<APIMentionableSelectComponent | MentionableSelectMenuComponentData>

Properties

public data: any

The API data associated with this component.

Methods

public addDefaultRoles(roles): this

Adds default roles to this auto populated select menu.

ParameterTypeOptionalDescription
rolesRestOrArray<string>The roles to add

public addDefaultUsers(users): this

Adds default users to this auto populated select menu.

ParameterTypeOptionalDescription
usersRestOrArray<string>The users to add

public addDefaultValues(values): this

Adds default values to this auto populated select menu.

ParameterTypeOptionalDescription
valuesRestOrArray<APISelectMenuDefaultValue<User>APISelectMenuDefaultValue<Role>>The values to add

public clearId(): this

Clears the id of this component, defaulting to a default incremented id.

public dispose(): MentionableSelectMenuKit

public filter(predicate): this

Sets a filter for the interaction collector.

ParameterTypeOptionalDescription
predicateSelectMenuKitPredicate<MentionableSelectMenuInteraction>The filter to use for the interaction collector.

public onEnd(handler): this

Sets the handler to run when the interaction collector ends.

ParameterTypeOptionalDescription
handlerCommandKitSelectMenuBuilderOnEndThe handler to run when the interaction collector ends.

public onError(handler): this

Sets the handler to run when the interaction collector ends.

ParameterTypeOptionalDescription
handlerEventInterceptorErrorHandlerThe handler to run when the interaction collector ends.

public onSelect(handler, data?): this

Sets the handler to run when the modal is submitted.

const modal = new MentionableSelectMenuKit()
.setTitle('My Modal')
.setCustomId('my-modal')
.filter((interaction) => interaction.Mentionable.id === '1234567890')
.onSelect(async (interaction) => {
await interaction.reply('You submitted the modal!');
})
.addComponents(actionRow1, actionRow2);
ParameterTypeOptionalDescription
handlerCommandKitSelectMenuBuilderInteractionCollectorDispatch<MentionableSelectMenuInteractionMentionableSelectMenuKit>
dataCommandKitSelectMenuBuilderInteractionCollectorDispatchContextDataThe context data for the interaction collector.

public setCustomId(customId): this

Sets the custom id for this select menu.

ParameterTypeOptionalDescription
customIdstringThe custom id to use

public setDefaultValues(values): this

Sets default values for this auto populated select menu.

ParameterTypeOptionalDescription
valuesRestOrArray<APISelectMenuDefaultValue<User>APISelectMenuDefaultValue<Role>>The values to set

public setDisabled(disabled?): this

Sets whether this select menu is disabled.

ParameterTypeOptionalDescription
disabledbooleanWhether this select menu is disabled

public setId(id): this

Sets the id (not the custom id) for this component.

ParameterTypeOptionalDescription
idnumberThe id for this component

public setMaxValues(maxValues): this

Sets the maximum values that must be selected in the select menu.

ParameterTypeOptionalDescription
maxValuesnumberThe maximum values that must be selected

public setMinValues(minValues): this

Sets the minimum values that must be selected in the select menu.

ParameterTypeOptionalDescription
minValuesnumberThe minimum values that must be selected

public setPlaceholder(placeholder): this

Sets the placeholder for this select menu.

ParameterTypeOptionalDescription
placeholderstringThe placeholder to use

public toJSON(): APIMentionableSelectComponent

ComponentBuilder.toJSON

public static from(other): MentionableSelectMenuBuilder

ParameterTypeOptional
otherAPIMentionableSelectComponentJSONEncodable<APIMentionableSelectComponent>