Class ComponentBuilder<T>

Type Parameters

Hierarchy

  • ComponentBuilder

Constructors

Properties

currentIndex: any
getCurrentRow: any
rowMax: RowMax
rows: any

Methods

  • Add a component to the current row, or a new row depending on certain conditions

    Parameters

    • component: ValidComponents

      The component to add.

    Returns ComponentBuilder<T>

  • Add several components.

    Parameters

    • Rest ...components: ValidComponents[]

      The components to add.

    Returns ComponentBuilder<T>

  • Add an interaction button to the current row.

    Parameters

    • options: AddInteractionButtonOptions

      The options for adding the interaction button.

    Returns ComponentBuilder<T>

  • Start a new action row.

    Parameters

    • Optional components: ValidComponents[]

      The components to start this new row with.

    Returns ComponentBuilder<T>

  • Add a select menu (to the current row, if empty - else as a new row).

    Parameters

    • options: AddSelectMenuOptions

      The options for adding the select menu.

    Returns ComponentBuilder<T>

  • Add a text input to the current row.

    Parameters

    • options: AddTextMenuOptions

      The options for adding the text input.

    Returns ComponentBuilder<T>

  • Add a url button to the current row

    Parameters

    • options: AddURLButtonOptions

      The options for adding the url button.

    Returns ComponentBuilder<T>

  • Remove all of the rows that are empty.

    Returns ComponentBuilder<T>

  • Parameters

    • rowMax: RowMax

    Returns ComponentBuilder<T>

  • convert the current contents to JSON

    Returns T[]

  • convert the current contents to JSON

    Returns ToRaw<T>[]

  • Convert an emoji to a partial.

    Example

    emojiToPartial("🐾", "default")
    

    Example

    emojiToPartial("<:paws8:681748079778463796>", "custom")
    

    Parameters

    • emoji: string

      The unicode point of the emoji if default, else the fully qualified emoji.

    • Optional type: "default" | "custom"

      default if built in (unicode), custom otherwise (this can be assumed from the format by us).

    Returns PartialEmoji

Generated using TypeDoc