class ContainerBuilder

export declare class ContainerBuilder extends ComponentBuilder<APIContainerComponent>

Constructors

constructor(
{ components, ...rest }?: Partial<APIContainerComponent>
)

Constructs a new instance of the ContainerBuilder class

protectedreadonly
data : ContainerBuilderData

Adds action row components to this container.

addFileComponents() : 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: number
) : this

Sets the accent color of this container.

setId(
id: number
) : this

Sets the id of 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

Examples:Remove the first component:
container.spliceComponents(0, 1);
Remove the first n components:
const n = 4;
container.spliceComponents(0, n);
Remove the last component:
container.spliceComponents(-1, 1);

toJSON(
validationOverride?: boolean
) : APIContainerComponent

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.