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

    Class MediaGalleryBuilder

    A builder that creates API-compatible JSON data for a container.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new media gallery from API data.

      Parameters

      Returns MediaGalleryBuilder

      Creating a media gallery from an API data object:

      const mediaGallery = new MediaGalleryBuilder({
      items: [
      {
      description: "Some text here",
      media: {
      url: 'https://cdn.discordapp.com/embed/avatars/2.png',
      },
      },
      ],
      });

      Creating a media gallery using setters and API data:

      const mediaGallery = new MediaGalleryBuilder({
      items: [
      {
      description: "alt text",
      media: {
      url: 'https://cdn.discordapp.com/embed/avatars/5.png',
      },
      },
      ],
      })
      .addItems(item2, item3);

    Properties

    data: Partial<DataType>

    The API data associated with this component.

    The components within this container.

    Methods

    • Clears the id of this component, defaulting to a default incremented id.

      Returns this

    • Sets the id (not the custom id) for this component.

      Parameters

      • id: number

        The id for this component

      Returns this