Replicas Handler
- class telegram_bot_discussion.handlers.replicas_handler.replicas_handler.ReplicasHandler[source]
Bases:
object- async access_control_list(user_id, replica_class)[source]
- Return type:
bool- Parameters:
user_id (int)
replica_class (Type[Replica])
- async middleware(update, context)[source]
Middleware work within handle(). If it returns None, handle() will not work.
- Return type:
Optional[Tuple[Update,CallbackContext]]- Parameters:
update (Update)
context (CallbackContext)
- async when_there_are_no_any_dialog(update, context)[source]
Do something if Telegram-bot does not have any dialogue with initiator (often - the User).
- Return type:
Optional[Tuple[Update,CallbackContext]]- Parameters:
update (Update)
context (CallbackContext)
- async handle(update, context)[source]
Catch all events, which are not commands calls and buttons clicks.
- Raises:
ChatIdWasNotFetched – If User was not detected, handle() try find other event initiator. If event initiator not found ChatIdWasNotFetched will be raised.
- Parameters:
update (Update)
context (CallbackContext)
- async get_replica_from_dialogue(update, context)[source]
- Parameters:
update (Update)
context (CallbackContext)