Class PaginationSent

Class that represents pagination that is already sent.

Hierarchy

  • PaginationSent

Constructors

  • Class that represents pagination that is already sent.

    Parameters

    • _data: PaginationData

      Embeds, buttons and so on.

    • _message: Message<boolean> | RepliableInteraction<CacheType>

      Message or interaction that pagination should be assigned to.

    • _page: number = 0

      Page which pagination should start from.

    • _beforeStopAction: StopAction = undefined

      Action that is completed before the pagination is stopped.

    • _onStopAction: StopAction = undefined

      Action that is completed after the pagination is stopped.

    Returns PaginationSent

Properties

_collector: InteractionCollector<ButtonInteraction<CacheType>>
_state: PaginationState = PaginationState.NotReady

Accessors

  • get attachedTo(): Message<boolean> | RepliableInteraction<CacheType>
  • Returns

    Message or interaction that pagination should be assigned to.

    Returns Message<boolean> | RepliableInteraction<CacheType>

  • get isActive(): boolean
  • Returns

    Is pagination active or not.

    Returns boolean

  • get page(): number
  • Returns

    Current page.

    Returns number

Methods

  • Builds action rows with enabled or disabled buttons.

    Returns

    Parameters

    • disabled: boolean = false

      Should be buttons disabled or not.

    Returns ActionRowBuilder<ButtonBuilder>[]

  • Builds action rows for specific page.

    Returns

    Returns Promise<ActionRowBuilder<ButtonBuilder>[]>

  • Called than the collector collects interaction.

    Returns

    Parameters

    • interaction: ButtonInteraction<CacheType>

      Interaction that is fired.

    Returns Promise<void>

  • Forms collector for pages.

    Returns

    Returns Promise<void>

  • Forms filtering function for collector.

    Returns

    Parameters

    • messageId: string

      Reply id.

    Returns ((interaction: ButtonInteraction<CacheType>) => Promise<boolean>)

      • (interaction: ButtonInteraction<CacheType>): Promise<boolean>
      • Forms filtering function for collector.

        Returns

        Parameters

        • interaction: ButtonInteraction<CacheType>

        Returns Promise<boolean>

  • Called than the pagination stopped.

    Returns

    Parameters

    • reason: string

      Reason why the pagination is stopped.

    Returns Promise<void>

  • Deletes pagination and stops it. If pagination is an ephemeral interaction stops it instead.

    Returns

    Returns Promise<void>

  • Gets button wrapper by custom id.

    Returns

    Button wrapper.

    Parameters

    • custom_id: string

      Custom id.

    Returns ButtonWrapper

  • Initializes pagination. Can be called only once. Default pagination wrapper calls it so you shouldn't.

    Returns

    Returns Promise<PaginationSent>

  • Switches pagination to the next page. It does not update the pagination, so you should call update by yourself!

    Returns

    Parameters

    • page: number

      Page number.

    Returns PaginationSent

  • Stops pagination.

    Returns

    Returns void

  • Updates pagination state.

    Returns

    Returns Promise<void>

Generated using TypeDoc