MediaGalleryItem
Represents an item within a MediaGallery.
Signature
export declare class MediaGalleryItemProperties
1Methods
5Properties
data: Partial<APIMediaGalleryItems>;Methods
constructorConstructorconstructor(data?: Partial<APIMediaGalleryItems>);setMedia(url: string): this;Sets the media URL for this gallery item.
Parameters
url- The URL of the media.
Returns
The updated MediaGalleryItem instance.
setDescription(desc: string): this;Sets the description for this gallery item.
Parameters
desc- The description text.
Returns
The updated MediaGalleryItem instance.
setSpoiler(spoiler?: boolean): this;Sets whether this gallery item should be visually marked as a spoiler.
Parameters
spoiler- Whether the item is a spoiler (defaults to true).
Returns
The updated MediaGalleryItem instance.
toJSON(): { media?: APIUnfurledMediaItem | undefined; description?: string | undefined; spoiler?: boolean | undefined;};Converts this MediaGalleryItem instance to its JSON representation.
Returns
The JSON representation of the item data.