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

    Class ThumbnailBuilder

    The base component builder that contains common symbols for all sorts of components.

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new thumbnail from API data.

      Parameters

      Returns ThumbnailBuilder

      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',
      },
      });

      Creating a thumbnail using setters and API data:

      const thumbnail = new ThumbnailBuilder({
      media: {
      url: 'attachment://image.png',
      },
      })
      .setDescription('alt text');

    Properties

    data: Partial<DataType>

    The API data associated with this component.

    Methods

    • Clears the description of this thumbnail.

      Returns this

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

      Returns this

    • Sets the description of this thumbnail.

      Parameters

      • description: string

        The description to use

      Returns this

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

      Parameters

      • id: number

        The id for this component

      Returns this

    • Sets the spoiler status of this thumbnail.

      Parameters

      • Optionalspoiler: boolean

        The spoiler status to use

      Returns this

    • Sets the media URL of this thumbnail.

      Parameters

      • url: string

        The URL to use

      Returns this