item type to map
CommandContext
original items to map
mapping function (item, builder) => SectionBuilder. A fresh SectionBuilder is passed as builder for each call.
OptionaltopSection: T
optional top section value (will be converted by calling mapper(topSection, new SectionBuilder()))
initial page (default: 1)
items per page (default: 10)
Optionalheader: string
optional header text
A MessagePagination instance
Map arbitrary items into
SectionBuilderinstances and callpaginate.The
mappermust have the signature(item: T, builder: SectionBuilder) => SectionBuilder. A freshSectionBuilderinstance is provided as the second argument to the mapper for each item; the mapper should populate and return that builder (or return a newSectionBuilder).