Section
Signature
export declare class Section<Ac extends Button | Thumbnail = Button | Thumbnail> extends BaseComponentBuilder<APISectionComponent>Properties
2Methods
5Properties
components: TextDisplay[];accessory?: Ac;Methods
constructorConstructorconstructor({ components, accessory, ...data }?: Partial<APISectionComponent>);addComponents(...components: RestOrArray<TextDisplay>): this;Adds components to this section.
Parameters
components- The components to add
Examples
section.addComponents(new TextDisplay().content('Hello'));setComponents(...components: RestOrArray<TextDisplay>): this;Sets the components for this section.
Parameters
components- The components to set
Examples
section.setComponents(new TextDisplay().content('Hello'));setAccessory(accessory: Ac): this;toJSON(): APISectionComponent;Converts this section to JSON.
Returns
The JSON representation of this section