peyk.dispatcher.middlewares.utils¶
Classes
|
Configuration for automatic callback-query acknowledgement. |
Automatically acknowledge callback queries after a handler succeeds. |
|
Send the action named by |
|
|
Keep a chat action alive while a handler is running. |
- class peyk.dispatcher.middlewares.utils.ChatActionSender(bot: _BotLike, chat_id: int | str, action: str = 'typing', interval: float = 4.0)[source]¶
Bases:
objectKeep a chat action alive while a handler is running.
- bot: _BotLike¶
- chat_id: int | str¶
- action: str = 'typing'¶
- interval: float = 4.0¶
- classmethod typing(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the typing operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod upload_photo(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the upload photo operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod record_video(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the record video operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod upload_video(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the upload video operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod record_voice(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the record voice operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod upload_document(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the upload document operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod choose_sticker(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the choose sticker operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod find_location(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the find location operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod record_video_note(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the record video note operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- classmethod upload_video_note(bot: _BotLike, chat_id: int | str, interval: float = 4.0) ChatActionSender[source]¶
Performs the upload video note operation for the dispatcher client.
- Parameters:
bot – Value used by this operation.
chat_id – Identifier of the target chat.
interval – Value used by this operation.
- Returns:
Result produced by the dispatcher operation.
- class peyk.dispatcher.middlewares.utils.ChatActionMiddleware[source]¶
Bases:
objectSend the action named by
flags.chat_actionaround a handler.