huruhuru - v0.0.2
    Preparing search index...

    Function paginateMap

    • Map each input to a SectionBuilder or TextDisplayBuilder, then paginate it. The mapper receives one argument, the input item. Null/undefined omit the top item; other values, including 0 and false, are mapped normally.

      Type Parameters

      • T

      Parameters

      • ctx: CommandContext
      • items: readonly T[]
      • mapper: (item: T) => SectionBuilder
      • OptionaltopSection: T | null
      • OptionalcurrentPage: number
      • OptionalpageSize: number
      • Optionalheader: string
      • Optionaloptions: PaginationOptions

      Returns Promise<MessagePagination<SectionBuilder>>

      await paginateMap(ctx, users, user => new TextDisplayBuilder().setContent(user.name));
      
    • Map each input to a SectionBuilder or TextDisplayBuilder, then paginate it. The mapper receives one argument, the input item. Null/undefined omit the top item; other values, including 0 and false, are mapped normally.

      Type Parameters

      • T

      Parameters

      • ctx: CommandContext
      • items: readonly T[]
      • mapper: (item: T) => TextDisplayBuilder
      • OptionaltopSection: T | null
      • OptionalcurrentPage: number
      • OptionalpageSize: number
      • Optionalheader: string
      • Optionaloptions: PaginationOptions

      Returns Promise<MessagePagination<TextDisplayBuilder>>

      await paginateMap(ctx, users, user => new TextDisplayBuilder().setContent(user.name));
      
    • Map each input to a SectionBuilder or TextDisplayBuilder, then paginate it. The mapper receives one argument, the input item. Null/undefined omit the top item; other values, including 0 and false, are mapped normally.

      Type Parameters

      • T

      Parameters

      • ctx: CommandContext
      • items: readonly T[]
      • mapper: (item: T) => ItemType
      • OptionaltopSection: T | null
      • OptionalcurrentPage: number
      • OptionalpageSize: number
      • Optionalheader: string
      • Optionaloptions: PaginationOptions

      Returns Promise<MessagePagination<ItemType>>

      await paginateMap(ctx, users, user => new TextDisplayBuilder().setContent(user.name));