class SectionBuilder

declare class SectionBuilder extends ComponentBuilder<APISectionComponent>

Constructors

constructor()

Creates a new section from API data.

readonly
components : readonly TextDisplayBuilder[]

protectedreadonly
data : SectionBuilderData

addTextDisplayComponents() : this

Adds text display components to this section.

clearId() : this

Clears the id of this component, defaulting to a default incremented id.

Inherited from: ComponentBuilder

setDangerButtonAccessory() : this

Sets a danger button component to be the accessory of this section.

setId(
id: number
) : this

Sets the id of this component.

Inherited from: ComponentBuilder

setLinkButtonAccessory() : this

Sets a URL button component to be the accessory of this section.

setPremiumButtonAccessory() : this

Sets a SKU id button component to be the accessory of this section.

setPrimaryButtonAccessory() : this

Sets a primary button component to be the accessory of this section.

setSecondaryButtonAccessory() : this

Sets a secondary button component to be the accessory of this section.

setSuccessButtonAccessory() : this

Sets a success button component to be the accessory of this section.

setThumbnailAccessory() : this

Sets a thumbnail component to be the accessory of this section.

spliceTextDisplayComponents() : this

Removes, replaces, or inserts text display components for this section.

toJSON(
validationOverride?: boolean
) : APISectionComponent

Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.