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

    Class SeparatorBuilder

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

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a new separator from API data.

      Parameters

      Returns SeparatorBuilder

      Creating a separator from an API data object:

      const separator = new SeparatorBuilder({
      spacing: SeparatorSpacingSize.Small,
      divider: true,
      });

      Creating a separator using setters and API data:

      const separator = new SeparatorBuilder({
      spacing: SeparatorSpacingSize.Large,
      })
      .setDivider(false);

    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

    • Clears the spacing of this separator.

      Returns this

    • Sets whether this separator should show a divider line.

      Parameters

      • Optionaldivider: boolean

        Whether to show a divider line

      Returns this

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

      Parameters

      • id: number

        The id for this component

      Returns this

    • Sets the spacing of this separator.

      Parameters

      Returns this

    • Serializes this builder to API-compatible JSON data.

      Returns APISeparatorComponent

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