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

    Class TextDisplayBuilder

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

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    • Creates a new text display from API data.

      Parameters

      Returns TextDisplayBuilder

      Creating a text display from an API data object:

      const textDisplay = new TextDisplayBuilder({
      content: 'some text',
      });

      Creating a text display using setters and API data:

      const textDisplay = new TextDisplayBuilder({
      content: 'old text',
      })
      .setContent('new text');

    Properties

    data: Partial<DataType>

    The API data associated with this component.

    Methods

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

      Returns this

    • Sets the text of this text display.

      Parameters

      • content: string

        The text to use

      Returns this

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

      Parameters

      • id: number

        The id for this component

      Returns this

    • Serializes this builder to API-compatible JSON data.

      Returns APITextDisplayComponent

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