ListMessageBuilder
extends MessageBuilder
in package
One page of search results as a Components V2 message: a heading, a numbered list, a picker that opens an entry, and Previous/Next buttons.
Shared by card, set and deck searches; each passes its own custom id
prefix, so <prefix>:open:<search>:<page> (the picker, valued with the
entry's id) and <prefix>:page:<search>:<page> land in its module.
Tags
Table of Contents
Constants
- PAGE_SIZE : int = 10
- Entries per page.
Methods
Constants
PAGE_SIZE
Entries per page.
public
int
PAGE_SIZE
= 10
Methods
page()
A page of results.
public
static page(string $prefix, string $search, int $page, int $total, string $title, array<string|int, string> $lines, array<string|int, array<string|int, mixed>> $choices, int $accent, string $noun) : static
Parameters
- $prefix : string
-
The module's custom id prefix (
card,set,deck). - $search : string
-
The search's id in the SearchCache.
- $page : int
-
1-based.
- $total : int
-
Entries across every page.
- $title : string
-
The heading.
- $lines : array<string|int, string>
-
This page's entries, rendered.
- $choices : array<string|int, array<string|int, mixed>>
-
This page's entries for the picker: {label, value, description?}.
- $accent : int
-
The container's accent color.
- $noun : string
-
What an entry is, for the count ("card", "set", "deck").
Return values
staticpages()
Pages needed for a number of entries.
public
static pages(int $total) : int
Parameters
- $total : int
Return values
int —At least 1.