ThumbnailBuilder

export declare class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent>
export declare class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent>

No summary provided.

constructor(data?)
Creates a new thumbnail from API data.
Example
Creating a thumbnail from an API data object:
const thumbnail = new ThumbnailBuilder({
description: 'some text',
media: {
url: 'https://cdn.discordapp.com/embed/avatars/4.png',
},
});
const thumbnail = new ThumbnailBuilder({
description: 'some text',
media: {
url: 'https://cdn.discordapp.com/embed/avatars/4.png',
},
});
Example
Creating a thumbnail using setters and API data:
const thumbnail = new ThumbnailBuilder({
media: {
url: 'attachment://image.png',
},
})
.setDescription('alt text');
const thumbnail = new ThumbnailBuilder({
media: {
url: 'attachment://image.png',
},
})
.setDescription('alt text');
NameTypeOptionalDescription
dataPartial<APIThumbnailComponent>YesThe API data to create this thumbnail with
ProtectedReadonly
clearDescription():this
Clears the description of this thumbnail.
clearId():this
Clears the id of this component, defaulting to a default incremented id.
Inherited from ComponentBuilder
setDescription(description):this
Sets the description of this thumbnail.
NameTypeOptionalDescription
descriptionstringNoThe description to use
setId(id):this
Sets the id of this component.
NameTypeOptionalDescription
idnumberNoThe id to use
Inherited from ComponentBuilder
setSpoiler(spoiler?):this
Sets the spoiler status of this thumbnail.
NameTypeOptionalDescription
spoilerbooleanYesThe spoiler status to use
setURL(url):this
Sets the media URL of this thumbnail.
NameTypeOptionalDescription
urlstringNoThe URL to use
toJSON(validationOverride?):APIThumbnailComponent
Serializes this builder to API-compatible JSON data.Note that by disabling validation, there is no guarantee that the resulting object will be valid.
NameTypeOptionalDescription
validationOverridebooleanYesForce validation to run/not run regardless of your global preference