added answer_chat_action() method for types.Message (#501)

This commit is contained in:
Arseniy Kulikov 2021-03-14 19:06:55 +03:00 committed by GitHub
parent 24fb07d3fe
commit 1354f8d58c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1416,6 +1416,30 @@ class Message(base.TelegramObject):
allow_sending_without_reply=allow_sending_without_reply,
reply_markup=reply_markup,
)
async def answer_chat_action(
self,
action: base.String,
) -> base.Boolean:
"""
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).
We only recommend using this method when a response from the bot will take
a noticeable amount of time to arrive.
Source: https://core.telegram.org/bots/api#sendchataction
:param action: Type of action to broadcast
:type action: :obj:`base.String`
:return: Returns True on success
:rtype: :obj:`base.Boolean`
"""
return await self.bot.send_chat_action(
chat_id=self.chat.id,
action=action,
)
async def reply(
self,