Preview environment

class MediaGalleryItemBuilder

export declare class MediaGalleryItemBuilder implements JSONEncodable<APIMediaGalleryItem>

Constructors

constructor()

Creates a new media gallery item from API data.

Examples:Creating a media gallery item from an API data object:
const item = new MediaGalleryItemBuilder({
	description: "Some text here",
	media: {
		url: 'https://cdn.discordapp.com/embed/avatars/2.png',
	},
});
Creating a media gallery item using setters and API data:
const item = new MediaGalleryItemBuilder({
	media: {
		url: 'https://cdn.discordapp.com/embed/avatars/5.png',
	},
})
	.setDescription("alt text");

readonly
data : Partial<APIMediaGalleryItem>

The API data associated with this media gallery item.

clearDescription() : this

Clears the description of this media gallery item.

setDescription(
description: string
) : this

Sets the description of this media gallery item.

setSpoiler(
spoiler?: boolean
) : this

Sets the spoiler status of this media gallery item.

setURL(
url: string
) : this

Sets the media URL of this media gallery item.

Serializes this builder to API-compatible JSON data.