class ContainerBuilder

external
declare class ContainerBuilder extends ComponentBuilder<APIContainerComponent>

Constructors

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

Constructs a new instance of the ContainerBuilder class

protectedreadonlyexternal
data : ContainerBuilderData

external
addActionRowComponents() : this

Adds action row components to this container.

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

Sets the accent color of this container.

external
setId(
id: number
) : this

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

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);

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