Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Telegram only recommends using this method when a r
(
self,
chat_id: str | int,
action: str,
message_thread_id: int | None = None,
business_connection_id: str | None = None,
*,
read_timeout: ODVInput[float] = DEFAULT_NONE,
write_timeout: ODVInput[float] = DEFAULT_NONE,
connect_timeout: ODVInput[float] = DEFAULT_NONE,
pool_timeout: ODVInput[float] = DEFAULT_NONE,
api_kwargs: JSONDict | None = None,
)
| 3729 | ) |
| 3730 | |
| 3731 | async def send_chat_action( |
| 3732 | self, |
| 3733 | chat_id: str | int, |
| 3734 | action: str, |
| 3735 | message_thread_id: int | None = None, |
| 3736 | business_connection_id: str | None = None, |
| 3737 | *, |
| 3738 | read_timeout: ODVInput[float] = DEFAULT_NONE, |
| 3739 | write_timeout: ODVInput[float] = DEFAULT_NONE, |
| 3740 | connect_timeout: ODVInput[float] = DEFAULT_NONE, |
| 3741 | pool_timeout: ODVInput[float] = DEFAULT_NONE, |
| 3742 | api_kwargs: JSONDict | None = None, |
| 3743 | ) -> bool: |
| 3744 | """ |
| 3745 | Use this method when you need to tell the user that something is happening on the bot's |
| 3746 | side. The status is set for 5 seconds or less (when a message arrives from your bot, |
| 3747 | Telegram clients clear its typing status). Telegram only recommends using this method when |
| 3748 | a response from the bot will take a noticeable amount of time to arrive. |
| 3749 | |
| 3750 | Args: |
| 3751 | chat_id (:obj:`int` | :obj:`str`): |chat_id_channel| |
| 3752 | action(:obj:`str`): Type of action to broadcast. Choose one, depending on what the user |
| 3753 | is about to receive. For convenience look at the constants in |
| 3754 | :class:`telegram.constants.ChatAction`. |
| 3755 | message_thread_id (:obj:`int`, optional): |message_thread_id_arg| |
| 3756 | |
| 3757 | .. versionadded:: 20.0 |
| 3758 | business_connection_id (:obj:`str`, optional): |business_id_str| |
| 3759 | |
| 3760 | .. versionadded:: 21.1 |
| 3761 | |
| 3762 | Returns: |
| 3763 | :obj:`bool`: On success, :obj:`True` is returned. |
| 3764 | """ |
| 3765 | data: JSONDict = { |
| 3766 | "chat_id": chat_id, |
| 3767 | "action": action, |
| 3768 | "message_thread_id": message_thread_id, |
| 3769 | "business_connection_id": business_connection_id, |
| 3770 | } |
| 3771 | return await self._post( |
| 3772 | "sendChatAction", |
| 3773 | data, |
| 3774 | read_timeout=read_timeout, |
| 3775 | write_timeout=write_timeout, |
| 3776 | connect_timeout=connect_timeout, |
| 3777 | pool_timeout=pool_timeout, |
| 3778 | api_kwargs=api_kwargs, |
| 3779 | ) |
| 3780 | |
| 3781 | def _effective_inline_results( |
| 3782 | self, |