huruhuru - v0.0.1
    Preparing search index...

    Function paginate

    • Create and register a paginated message.

      Parameters

      • ctx: CommandContext

        CommandContext wrapping an interaction or message

      • items: { toString(): string }[]

        Items to paginate. Each item may be a SectionBuilder or any object with toString()

      • OptionaltopSection: { toString(): string } | null

        Optional header SectionBuilder or an object with toString() used as the top section

      • OptionalcurrentPage: number

        1-based page to open initially (default: 1)

      • OptionalpageSize: number

        Items per page (default: 10)

      • Optionalheader: string

        Optional header text displayed above sections

      Returns Promise<MessagePagination<TextDisplayBuilder>>

      A MessagePagination instance that can be used to control the pagination programmatically

      // Simple usage
      const items = ["one", "two", "three", "four"];
      // Without a top section
      await paginate(ctx, items, null, 1, 2, "My Paginated Message");
      // With a top section
      await paginate(ctx, items, "Items:", 1, 2, "My Paginated Message");
    • Create and register a paginated message.

      Parameters

      • ctx: CommandContext

        CommandContext wrapping an interaction or message

      • items: SectionBuilder[]

        Items to paginate. Each item may be a SectionBuilder or any object with toString()

      • OptionaltopSection: SectionBuilder | null

        Optional header SectionBuilder or an object with toString() used as the top section

      • OptionalcurrentPage: number

        1-based page to open initially (default: 1)

      • OptionalpageSize: number

        Items per page (default: 10)

      • Optionalheader: string

        Optional header text displayed above sections

      Returns Promise<MessagePagination<SectionBuilder>>

      A MessagePagination instance that can be used to control the pagination programmatically

      // Simple usage
      const items = ["one", "two", "three", "four"];
      // Without a top section
      await paginate(ctx, items, null, 1, 2, "My Paginated Message");
      // With a top section
      await paginate(ctx, items, "Items:", 1, 2, "My Paginated Message");