Tourmaline::PaginatedKeyboard
Convenience class for creating an InlineKeyboard with built in pagination.
It is designed to be customizable so as not to get in your way.
Constructors
new(results = [] of String, per_page = 10, &block : self -> )
Creates a new PaginatedKeyboard, yielding the newly created keyboard to the block
Arguments
results- the initial set of resultsper_page- the number of results to show on each pageheader- text to be displayed above the resultsfooter- text to be displayed below the resultsprefix- a string to be added to the beginning of each itemback_text- text to use for the back buttonnext_text- text to use for the next buttonid- an id to be used both as thegroupname, and the prefix for the callback query data
Formatting
The params header, footer, and prefix are formatted prior to being injected into the message.
{page}- will be replaced with the current page number, starting at 1{page count}- will be replaced with the total number of pages{index}- forprefixonly, gets replaced with the index of the current item, starting at 1
Instance methods
<<(*args, **options)
Source<<(*args, **options, &)
Sourceback_button_procs
Sourcedelete(*args, **options)
Sourcedelete(*args, **options, &)
Sourceeach(*args, **options)
Sourceeach(*args, **options, &)
Sourceevent_handler
Sourceheader
Sourceid
Sourceindex(*args, **options)
Sourceindex(*args, **options, &)
Sourcekeyboard
Sourcenext_button_procs
Sourceper_page
Sourceprefix
Sourcepush(*args, **options)
Sourcepush(*args, **options, &)
Sourceresults
Source