A builder that creates API-compatible JSON data for a container.
Creates a new container from API data.
Example
Creating a container from an API data object:Example
Creating a container using setters and API data:Name | Type | Optional | Description |
---|---|---|---|
data | Partial<APIContainerComponent> | Yes | The API data to create this container with |
The API data associated with this component.
Inherited from ComponentBuilderAdds action row components to this container.
Name | Constraints | Optional | Default | Description |
---|---|---|---|---|
ComponentType | MessageActionRowComponentBuilder | No | None |
Name | Type | Optional | Description |
---|---|---|---|
...components | RestOrArray<ActionRowBuilder<ComponentType> | APIActionRowComponent<APIComponentInMessageActionRow> | ((builder: ActionRowBuilder<ComponentType>) => ActionRowBuilder<ComponentType>)> | No | The action row components to add |
Adds file components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...components | RestOrArray<APIFileComponent | FileBuilder | ((builder: FileBuilder) => FileBuilder)> | No | The file components to add |
Adds media gallery components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...components | RestOrArray<APIMediaGalleryComponent | MediaGalleryBuilder | ((builder: MediaGalleryBuilder) => MediaGalleryBuilder)> | No | The media gallery components to add |
Adds section components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...components | RestOrArray<APISectionComponent | SectionBuilder | ((builder: SectionBuilder) => SectionBuilder)> | No | The section components to add |
Adds separator components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...components | RestOrArray<APISeparatorComponent | SeparatorBuilder | ((builder: SeparatorBuilder) => SeparatorBuilder)> | No | The separator components to add |
Adds text display components to this container.
Name | Type | Optional | Description |
---|---|---|---|
...components | 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.
Sets the id (not the custom id) for this component.
Name | Type | Optional | Description |
---|---|---|---|
id | number | No | The id for this component |
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.
Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start removing, replacing or inserting components |
deleteCount | number | No | The amount of components to remove |
...components | RestOrArray<APIComponentInContainer | ContainerComponentBuilder> | No | The components to set |
Serializes this builder to API-compatible JSON data.