No summary provided.
Extends
ComponentBuilder<APISectionComponent>Creates a new section from API data.
Example
Creating a section from an API data object:Example
Creating a section using setters and API data:Name | Type | Optional | Description |
---|---|---|---|
data | Partial<APISectionComponent> | Yes | The API data to create this section with |
Adds text display components to this section.
Name | Type | Optional | Description |
---|---|---|---|
...input | RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)> | No | The text display components to add |
Clears the id of this component, defaulting to a default incremented id.
Inherited from ComponentBuilderSets a danger button component to be the accessory of this section.
Name | Type | Optional | Description |
---|---|---|---|
input | DangerButtonBuilder | ((builder: DangerButtonBuilder) => DangerButtonBuilder) | (APIButtonComponentWithCustomId & { style: ButtonStyle.Danger; }) | No | The button to set as the accessory |
Sets the id of this component.
Name | Type | Optional | Description |
---|---|---|---|
id | number | No | The id to use |
Sets a URL button component to be the accessory of this section.
Name | Type | Optional | Description |
---|---|---|---|
input | APIButtonComponentWithURL | LinkButtonBuilder | ((builder: LinkButtonBuilder) => LinkButtonBuilder) | No | The button to set as the accessory |
Sets a SKU id button component to be the accessory of this section.
Name | Type | Optional | Description |
---|---|---|---|
input | APIButtonComponentWithSKUId | PremiumButtonBuilder | ((builder: PremiumButtonBuilder) => PremiumButtonBuilder) | No | The button to set as the accessory |
Sets a primary button component to be the accessory of this section.
Name | Type | Optional | Description |
---|---|---|---|
input | PrimaryButtonBuilder | ((builder: PrimaryButtonBuilder) => PrimaryButtonBuilder) | (APIButtonComponentWithCustomId & { style: ButtonStyle.Primary; }) | No | The button to set as the accessory |
Sets a secondary button component to be the accessory of this section.
Name | Type | Optional | Description |
---|---|---|---|
input | SecondaryButtonBuilder | ((builder: SecondaryButtonBuilder) => SecondaryButtonBuilder) | (APIButtonComponentWithCustomId & { style: ButtonStyle.Secondary; }) | No | The button to set as the accessory |
Sets a success button component to be the accessory of this section.
Name | Type | Optional | Description |
---|---|---|---|
input | SuccessButtonBuilder | ((builder: SuccessButtonBuilder) => SuccessButtonBuilder) | (APIButtonComponentWithCustomId & { style: ButtonStyle.Success; }) | No | The button to set as the accessory |
Sets a thumbnail component to be the accessory of this section.
Name | Type | Optional | Description |
---|---|---|---|
input | APIThumbnailComponent | ThumbnailBuilder | ((builder: ThumbnailBuilder) => ThumbnailBuilder) | No | The thumbnail to set as the accessory |
Removes, replaces, or inserts text display components for this section.
Name | Type | Optional | Description |
---|---|---|---|
index | number | No | The index to start removing, replacing or inserting text display components |
deleteCount | number | No | The amount of text display components to remove |
...components | RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)> | No | The text display components to insert |
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 |