declare class ContainerBuilder extends ComponentBuilder<APIContainerComponent>
A builder that creates API-compatible JSON data for containers.
Constructors
externaldata?: Partial<APIContainerComponent>) constructor(
Creates a new container builder.
readonlyexternalreadonly ContainerComponentBuilders[] components :
Gets the components within this container.
external addActionRowComponents...input: RestOrArray<ActionRowBuilder | APIActionRowComponent<APIComponentInMessageActionRow> | ((builder: ActionRowBuilder) => ActionRowBuilder)>) : this (
Adds action row components to this container.
external addFileComponents...input: RestOrArray<APIFileComponent | FileBuilder | ((builder: FileBuilder) => FileBuilder)>) : this (
Adds file components to this container.
external addMediaGalleryComponents...input: RestOrArray<APIMediaGalleryComponent | MediaGalleryBuilder | ((builder: MediaGalleryBuilder) => MediaGalleryBuilder)>) : this (
Adds media gallery components to this container.
external addSectionComponents...input: RestOrArray<APISectionComponent | SectionBuilder | ((builder: SectionBuilder) => SectionBuilder)>) : this (
Adds section components to this container.
external addSeparatorComponents...input: RestOrArray<APISeparatorComponent$1 | SeparatorBuilder | ((builder: SeparatorBuilder) => SeparatorBuilder)>) : this (
Adds separator components to this container.
external addTextDisplayComponents...input: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>) : this (
Adds text display components to this container.
Clears the id of this component, defaulting to a default incremented id.
Inherited from: ComponentBuilder
external setAccentColorcolor: number) : this (
Sets the accent color of this container.
external setSpoilerspoiler?: boolean) : this (
Sets the spoiler status of this container.
external spliceComponentsindex: numberdeleteCount: number...components: RestOrArray<APIComponentInContainer | ContainerComponentBuilders>) : this (
Removes, replaces, or inserts components for this container
container.spliceComponents(0, 1);
const n = 4;
container.spliceComponents(0, n);
container.spliceComponents(-1, 1);
external toJSONvalidationOverride?: 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.