PageMenu(name: str, menu_id: str, content: Union[pyrogram.client.types.input_media.input_media.InputMedia, str], items: Union[List[pyrubrum.keyboard.element.Element], Callable[[ParameterizedHandler, pyrogram.client.client.Client, Any, Dict[str, Any]], List[pyrubrum.keyboard.element.Element]]], deep_link: Optional[bool] = False, default: Optional[bool] = False, message_filter: Optional[pyrogram.client.filters.filter.Filter] = None, preliminary: Optional[Union[Callable[[Handler, pyrogram.client.client.Client, Any, Dict[str, Any]], None], List[Callable[[Handler, pyrogram.client.client.Client, Any, Dict[str, Any]], None]]]] = None, style: pyrubrum.menus.styles.base_style.BaseStyle = <pyrubrum.menus.styles.page_style.PageStyle object>)¶
Implementation of a menu which automatically, given a list of items, manages paging and the setting of parameters. It has got, by definition, all the parameters defined in
Menuplus a list of items that will be displayed to the user.
For understanding how the keyboard is being generated, see
menu_id (str) – The unique identifier given to the menu, which will refer unequivocally to this entity. The hash for this class is generated relying on the content of this field. Avoid using
0as it is used for buttons whose purpose is only related to design (i.e. they do not point to any menu, see Null-pointer button). See
BaseMenufor more information.
content (Types.Content) –
What will be displayed whenever a user accesses this menu. Both text and media can be provided. A function can be provided as well and must follow the following arguments pattern:
func(handler, client, context, parameters)
Menufor more information.
items (types.Items) – The list of elements the menu is compounded of or a function which returns such type of value.
deep_link (Optional[bool]) – If this menu shall be reached by a deep-link whose payload is the identifier of this instance. Defaults to
message_filter (Optional[Filter]) –
A filter for telling Pyrogram when a message should be associated to this menu. It works only for top-level menus (see
Handler.setup). Defaults to
None, which automatically makes this menu reachable when the user texts a message that follows this pattern:
preliminary (Types.Preliminary) – A function which is executed each time before doing anything else in
on_message. You can provide a list of such functions as well, which will be executed following the same order as the one of the list. Defaults to
None, which means that no function is going to be executed.
This implementation is not compatible with a non-parameterized handler. An handler that supports parameterization is required.