Preview environment

class SectionBuilder

external
declare class SectionBuilder extends ComponentBuilder<APISectionComponent>

A builder that creates API-compatible JSON data for a section.

Constructors

constructor()

Creates a new section from API data.

readonlyoptionalexternal
accessory? : ButtonBuilder | ThumbnailBuilder

The accessory of this section.

readonlyexternal
components : ComponentBuilder[]

The components within this section.

readonlyexternal
data : Partial<APISectionComponent>

The API data associated with this component.

Inherited from: ComponentBuilder

external
addTextDisplayComponents() : this

Adds text display components to this section.

external
clearId() : this

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

Inherited from: ComponentBuilder

external
setButtonAccessory() : this

Sets the accessory of this section to a button.

external
setId(
id: number
) : this

Sets the id (not the custom id) for this component.

Inherited from: ComponentBuilder

external
setThumbnailAccessory() : this

Sets the accessory of this section to a thumbnail.

external
spliceTextDisplayComponents() : this

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

external
toJSON() : APISectionComponent

Serializes this builder to API-compatible JSON data.