No summary provided.
Constructs a new instance of the
ContainerBuilder
className | Type | Optional | Description |
---|---|---|---|
{ components, ...rest } | Partial<APIContainerComponent> | Yes | None |
Adds action row components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<ActionRowBuilder | APIActionRowComponent<APIComponentInMessageActionRow> | ((builder: ActionRowBuilder) => ActionRowBuilder)> | No | The action row to add |
Adds file components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APIFileComponent | FileBuilder | ((builder: FileBuilder) => FileBuilder)> | No | The file components to add |
Adds media gallery components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APIMediaGalleryComponent | MediaGalleryBuilder | ((builder: MediaGalleryBuilder) => MediaGalleryBuilder)> | No | The media gallery components to add |
Adds section components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APISectionComponent | SectionBuilder | ((builder: SectionBuilder) => SectionBuilder)> | No | The section components to add |
Adds separator components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APISeparatorComponent | SeparatorBuilder | ((builder: SeparatorBuilder) => SeparatorBuilder)> | No | The separator components to add |
Adds text display components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)> | No | The text display components to add |
Clears the accent color of this container.
Clears the id of this component, defaulting to a default incremented id.
Inherited from ComponentBuilderSets the accent color of this container.
Name | Type | Optional | Description |
---|---|---|---|
color | number | No | The color to use |
Sets the id of this component.
Name | Type | Optional | Description |
---|---|---|---|
id | number | No | The id to use |
Sets the spoiler status of this container.
Name | Type | Optional | Description |
---|---|---|---|
spoiler | boolean | Yes | The spoiler status to use |
Removes, replaces, or inserts components for this container
Remarks
This method behaves similarly to Array.prototype.splice().It's useful for modifying and adjusting order of the already-existing components of a container.Example
Remove the first component:Example
Remove the first n components:Example
Remove the last component:Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start at |
deleteCount | number | No | The number of components to remove |
...components | RestOrArray<APIComponentInContainer | ContainerComponentBuilders> | No | The replacing component objects |
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
Name | Type | Optional | Description |
---|---|---|---|
validationOverride | boolean | Yes | Force validation to run/not run regardless of your global preference |