ParameterizedHandler(nodes: Set[pyrubrum.tree.node.Node], database: pyrubrum.database.base_database.BaseDatabase)¶
Implementation of an handler which mixes the features of
ParameterizedBaseHandlerand has got, by definition, multiple top-level nodes whose linked menu are displayed to the user whenever a message is being handled and matches one of their filters, and a database with which it is possible to perform parameterization (i.e. it supports parameters).
Make all the defined menus reachable by the client by adding handlers that catch all their identifiers to it. It adds support to parameterization by applying
ParameterizedBaseHandler.filterto all the handled callback queries. It also calls
pass_parameterized_handler, which lets the callback functions get this handler as argument and deletes handled callback queries from the database relying on the passed identifiers.
Finally, it makes the top-level menus reachable whenever a message is sent to the bot and matches one of their filters.
client (Client) – The client which is being set up.
The functions the handlers make use of are not set up in the same way objects added using Pyrogram handlers are. Pyrubrum implements the following pattern:
callback(handler, client, context, parameters)