Thumbnail
Represents a thumbnail component builder. Used to display a small image preview, often alongside other content.
Signature
export declare class Thumbnail extends BaseComponentBuilder<APIThumbnailComponent>JSDoc
Examples
const thumbnail = new Thumbnail()
.setMedia('https://example.com/thumbnail.jpg')
.setDescription('A cool thumbnail');Properties
0No properties.
Methods
5Methods
constructorConstructorconstructor(data?: Partial<APIThumbnailComponent>);setSpoiler(spoiler?: boolean): this;Sets whether the thumbnail should be visually marked as a spoiler.
Parameters
spoiler- Whether the thumbnail is a spoiler (defaults to true).
Returns
The updated Thumbnail instance.
setDescription(description: string | undefined): this;Sets the description for the thumbnail.
Parameters
description- The description text. Can be undefined to remove the description.
Returns
The updated Thumbnail instance.
setId(id: number): this;Sets the ID for the thumbnail component.
Parameters
id- The ID to set.
Returns
The updated Thumbnail instance.
setMedia(url: string): this;Sets the media URL for the thumbnail.
Parameters
url- The URL of the image to display as a thumbnail.
Returns
The updated Thumbnail instance.