declare class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent>
Constructors
data?: Partial<APIThumbnailComponent>)
constructor(data?: Partial<APIThumbnailComponent>
Creates a new thumbnail from API data.
Examples:Creating a thumbnail from an API data object:Creating a thumbnail using setters and API data:
const thumbnaik = new ThumbnailBuilder({
description: 'some text',
media: {
url: 'https://cdn.discordapp.com/embed/avatars/4.png',
},
});
const thumbnail = new ThumbnailBuilder({
media: {
url: 'attachment://image.png',
},
})
.setDescription('alt text');
readonlyexternalPartial<APIThumbnailComponent> data :
The API data associated with this component.
Inherited from: ComponentBuilder
Clears the id of this component, defaulting to a default incremented id.
Inherited from: ComponentBuilder
external setDescriptiondescription: string) : this (
description: string
Sets the description of this thumbnail.
external setIdid: number) : this (
id: number
Sets the id (not the custom id) for this component.
Inherited from: ComponentBuilder
external setSpoilerspoiler?: boolean) : this (
spoiler?: boolean
Sets the spoiler status of this thumbnail.
external setURLurl: string) : this (
url: string
Sets the media URL of this thumbnail.
external toJSONAPIThumbnailComponent () :
Serializes this builder to API-compatible JSON data.