Buttons Handler
- class telegram_bot_discussion.handlers.buttons_handler.buttons_handler.ButtonsHandler(coder, buttons_map)[source]
Bases:
object- Parameters:
coder (CoderInterface)
buttons_map (ButtonsMap)
-
coder:
CoderInterface how to serialize and deserialize stored in button data.
- Type:
-
buttons_map:
ButtonsMap accordance of action and Button class.
- Type:
- set_buttons_map(buttons_map)[source]
- Parameters:
buttons_map (ButtonsMap)
- async access_control_list(context, user_id, button_class)[source]
Check user access to Button-class within handle().
- Return type:
bool- Parameters:
context (CallbackContext)
user_id (int)
button_class (Type[Button])
Buttons handler exceptions
- exception telegram_bot_discussion.handlers.buttons_handler.exceptions.access_deny.ButtonClassAccessDeny(user_id, button_class)[source]
Bases:
Exception- Parameters:
user_id (int)
button_class (str | Type[Button])
-
user_id:
int
- exception telegram_bot_discussion.handlers.buttons_handler.exceptions.buttons_map_is_empty.ButtonsMapIsEmpty[source]
Bases:
Exception
- exception telegram_bot_discussion.handlers.buttons_handler.exceptions.life_time_overflow.ButtonClassLifeTimeOverflow(button_class)[source]
Bases:
Exception- Parameters:
button_class (str | Type[Button])