Preview environment

class ContainerBuilder

external
declare class ContainerBuilder extends ComponentBuilder<APIContainerComponent>

A builder that creates API-compatible JSON data for a container.

Constructors

constructor()

Creates a new container from API data.

readonlyexternal
components : ContainerComponentBuilder[]

The components within this container.

readonlyexternal
data : Partial<APIContainerComponent>

The API data associated with this component.

Inherited from: ComponentBuilder

external
addActionRowComponents<

ComponentType extends MessageActionRowComponentBuilder

>(
...components: RestOrArray<ActionRowBuilder<ComponentType> | APIActionRowComponent<APIComponentInMessageActionRow> | ((builder: ActionRowBuilder<ComponentType>) => ActionRowBuilder<ComponentType>)>
) : this

Adds action row components to this container.

external
addFileComponents(
...components: RestOrArray<APIFileComponent | FileBuilder | ((builder: FileBuilder) => FileBuilder)>
) : this

Adds file components to this container.

external
addMediaGalleryComponents() : this

Adds media gallery components to this container.

external
addSectionComponents() : this

Adds section components to this container.

external
addSeparatorComponents() : this

Adds separator components to this container.

external
addTextDisplayComponents() : this

Adds text display components to this container.

external
clearAccentColor() : this

Clears the accent color of this container.

external
clearId() : this

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

Inherited from: ComponentBuilder

external
setAccentColor(
color?: RGBTuple | number
) : this

Sets the accent color of this container.

external
setId(
id: number
) : this

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

Inherited from: ComponentBuilder

external
setSpoiler(
spoiler?: boolean
) : this

Sets the spoiler status of this container.

external
spliceComponents() : this

Removes, replaces, or inserts components for this container.

external
toJSON() : APIContainerComponent

Serializes this builder to API-compatible JSON data.