Discord.https - v3.0.16
    Preparing search index...

    Class MediaGalleryItemBuilder

    Implements

    Index

    Constructors

    • Creates a new media gallery item from API data.

      Parameters

      Returns MediaGalleryItemBuilder

      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");

    Properties

    data: Partial<APIMediaGalleryItem>

    The API data associated with this media gallery item.

    Methods

    • Clears the description of this media gallery item.

      Returns this

    • Sets the description of this media gallery item.

      Parameters

      • description: string

        The description to use

      Returns this

    • Sets the spoiler status of this media gallery item.

      Parameters

      • Optionalspoiler: boolean

        The spoiler status to use

      Returns this

    • Sets the media URL of this media gallery item.

      Parameters

      • url: string

        The URL to use

      Returns this

    • Serializes this builder to API-compatible JSON data.

      Returns APIMediaGalleryItem

      This method runs validations on the data before serializing it. As such, it may throw an error if the data is invalid.