Preview environment

class ContainerBuilder

export 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.

readonly
components : ContainerComponentBuilder[]

The components within this container.

The API data associated with this component.

Inherited from: ComponentBuilder

addActionRowComponents<

ComponentType extends MessageActionRowComponentBuilder

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

Adds action row components to this container.

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

Adds file components to this container.

addMediaGalleryComponents() : this

Adds media gallery components to this container.

addSectionComponents() : this

Adds section components to this container.

addSeparatorComponents() : this

Adds separator components to this container.

addTextDisplayComponents() : this

Adds text display components to this container.

clearAccentColor() : this

Clears the accent color of this container.

clearId() : this

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

Inherited from: ComponentBuilder

setAccentColor(
color?: RGBTuple | number
) : this

Sets the accent color of this container.

setId(
id: number
) : this

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

Inherited from: ComponentBuilder

setSpoiler(
spoiler?: boolean
) : this

Sets the spoiler status of this container.

spliceComponents() : this

Removes, replaces, or inserts components for this container.

Serializes this builder to API-compatible JSON data.