Basic representation of an handler, which is an entity that manages the setup of a
Clientinstance (i.e. the bot).
The purpose of this class is to give a general interface for an handler, even if it already implements both a sample setup and a keyboard processing function.
In order to create a subclass or to access this interface, you will need to implement the abstract method
get_menus. Otherwise, you will get an error.
This abstract method is intended to be implemented as a collector of all the menus which were defined while initializing this object.
The set of the menus that were collected during the lookup process.
- Return type
process_keyboard(keyboard: List[List[pyrubrum.keyboard.button.Button]], callback_query_id: str, chat_id: int) → List[List[pyrogram.client.types.bots_and_keyboards.inline_keyboard_button.InlineKeyboardButton]]¶
Given a list which represents an inline keyboard, a unique identifier for the callback and one for the chat from which the query was called, generate a Pyrogram-compatible inline keyboard.
The generated keyboard in a Pyrogram-compatible type.
- Return type
Make all the defined menus reachable by the client by adding handlers that catch all their identifiers to it. It also calls
pass_handler, which lets the callback functions get this handler as argument.
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)