declare class SectionBuilder extends ComponentBuilder<APISectionComponent>
Constructors
externaldata?: Partial<APISectionComponent>) constructor(
Creates a new section from API data.
const section = new SectionBuilder({
components: [
{
content: "Some text here",
type: ComponentType.TextDisplay,
},
],
accessory: {
media: {
url: 'https://cdn.discordapp.com/embed/avatars/3.png',
},
}
});
const section = new SectionBuilder({
components: [
{
content: "# Heading",
type: ComponentType.TextDisplay,
},
],
})
.setPrimaryButtonAccessory(button);
readonlyexternalreadonly TextDisplayBuilder[] components :
protectedreadonlyexternalSectionBuilderData data :
external addTextDisplayComponents...input: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>) : this (
Adds text display components to this section.
Clears the id of this component, defaulting to a default incremented id.
Inherited from: ComponentBuilder
external setDangerButtonAccessoryinput: DangerButtonBuilder | ((builder: DangerButtonBuilder) => DangerButtonBuilder) | (APIButtonComponentWithCustomId & { style: ButtonStyle.Danger; })) : this (
Sets a danger button component to be the accessory of this section.
external setLinkButtonAccessoryinput: APIButtonComponentWithURL | LinkButtonBuilder | ((builder: LinkButtonBuilder) => LinkButtonBuilder)) : this (
Sets a URL button component to be the accessory of this section.
external setPremiumButtonAccessoryinput: APIButtonComponentWithSKUId | PremiumButtonBuilder | ((builder: PremiumButtonBuilder) => PremiumButtonBuilder)) : this (
Sets a SKU id button component to be the accessory of this section.
external setPrimaryButtonAccessoryinput: PrimaryButtonBuilder | ((builder: PrimaryButtonBuilder) => PrimaryButtonBuilder) | (APIButtonComponentWithCustomId & { style: ButtonStyle.Primary; })) : this (
Sets a primary button component to be the accessory of this section.
external setSecondaryButtonAccessoryinput: SecondaryButtonBuilder | ((builder: SecondaryButtonBuilder) => SecondaryButtonBuilder) | (APIButtonComponentWithCustomId & { style: ButtonStyle.Secondary; })) : this (
Sets a secondary button component to be the accessory of this section.
external setSuccessButtonAccessoryinput: SuccessButtonBuilder | ((builder: SuccessButtonBuilder) => SuccessButtonBuilder) | (APIButtonComponentWithCustomId & { style: ButtonStyle.Success; })) : this (
Sets a success button component to be the accessory of this section.
external setThumbnailAccessoryinput: APIThumbnailComponent | ThumbnailBuilder | ((builder: ThumbnailBuilder) => ThumbnailBuilder)) : this (
Sets a thumbnail component to be the accessory of this section.
external spliceTextDisplayComponentsindex: numberdeleteCount: number...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>) : this (
Removes, replaces, or inserts text display components for this section.
external toJSONvalidationOverride?: 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.