huruhuru - v0.0.2
    Preparing search index...

    Function paginate

    • Create and register a pagination. Existing positional arguments remain supported.

      Type Parameters

      Parameters

      • ctx: CommandContext

        Context wrapping an interaction or message.

      • items: readonly T[]

        Sections, text displays, or values with toString(). Mixed types are supported.

      • OptionaltopSection: Top | null

        Optional item repeated on every page; its number is 0.

      • currentPage: number = 1

        Initial page, starting at 1.

      • pageSize: number = 10

        Maximum items per page. Pages may be smaller to satisfy Discord limits.

      • Optionalheader: string

        Optional text supporting {{page}} and {{pages}}.

      • options: PaginationOptions = {}

        Appearance, collector timeouts, and error handling.

      Returns Promise<MessagePagination<NormalizedItem<T | Top>>>

      RangeError for invalid page arguments or an item too large for a message.

      await paginate(ctx, ["{{number}}. one", "{{number}}. two"], null, 1, 10, "{{page}}/{{pages}}");