Search...

ChannelSelectMenuBuilder

export declare class ChannelSelectMenuBuilder extends BaseSelectMenuBuilder<APIChannelSelectComponent> 
export declare class ChannelSelectMenuBuilder extends BaseSelectMenuBuilder<APIChannelSelectComponent> 

No summary provided.

Extends

BaseSelectMenuBuilder<APIChannelSelectComponent>

constructor(data?)

Creates a new select menu from API data
Example
Creating a select menu from an API data object
const selectMenu = new ChannelSelectMenuBuilder({
	custom_id: 'a cool select menu',
	placeholder: 'select an option',
	max_values: 2,
});
const selectMenu = new ChannelSelectMenuBuilder({
	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 ChannelSelectMenuBuilder({
	custom_id: 'a cool select menu',
})
	.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
	.setMinValues(2)
const selectMenu = new ChannelSelectMenuBuilder({
	custom_id: 'a cool select menu',
})
	.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
	.setMinValues(2)
NameTypeOptionalDescription
dataPartial<APIChannelSelectComponent>YesThe API data to create this select menu with
Readonly

data

:

Partial<DataType>

The API data associated with this component
Inherited from ComponentBuilder

addChannelTypes(types)

:

this

NameTypeOptionalDescription
typesRestOrArray<ChannelType>NoNone

setChannelTypes(types)

:

this

NameTypeOptionalDescription
typesRestOrArray<ChannelType>NoNone

setCustomId(customId)

:

this

Sets the custom id for this select menu
NameTypeOptionalDescription
customIdstringNoThe custom id to use for this select menu
Inherited from BaseSelectMenuBuilder

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 for this select menu
Inherited from BaseSelectMenuBuilder

toJSON()

:

APIChannelSelectComponent

Serializes this component to an API-compatible JSON object
Remarks
This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.