From c31d8c0d09187fe2309c97b426c43f7aad5d9077 Mon Sep 17 00:00:00 2001 From: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com> Date: Fri, 21 Jun 2024 19:41:18 +0200 Subject: [PATCH] API 7.5 Documentation Changes --- docs/substitutions/global.rst | 2 ++ telegram/_bot.py | 12 ++++++++---- telegram/_inline/inlinekeyboardbutton.py | 6 ++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/substitutions/global.rst b/docs/substitutions/global.rst index 37edc74a446..534d752e6de 100644 --- a/docs/substitutions/global.rst +++ b/docs/substitutions/global.rst @@ -16,6 +16,8 @@ .. |editreplymarkup| replace:: It is currently only possible to edit messages without :attr:`telegram.Message.reply_markup` or with inline keyboards. +.. |bcid_edit_time| replace:: Note that business messages that were not sent by the bot and do not contain an inline keyboard can only be edited within *48 hours* from the time they were sent. + .. |toapikwargsbase| replace:: These arguments are also considered by :meth:`~telegram.TelegramObject.to_dict` and :meth:`~telegram.TelegramObject.to_json`, i.e. when passing objects to Telegram. Passing them to Telegram is however not guaranteed to work for all kinds of objects, e.g. this will fail for objects that can not directly be JSON serialized. .. |toapikwargsarg| replace:: Arbitrary keyword arguments. Can be used to store data for which there are no dedicated attributes. |toapikwargsbase| diff --git a/telegram/_bot.py b/telegram/_bot.py index ebc7817b9d2..1c87d506955 100644 --- a/telegram/_bot.py +++ b/telegram/_bot.py @@ -3957,7 +3957,8 @@ async def edit_message_text( Use this method to edit text and game messages. Note: - |editreplymarkup|. + * |editreplymarkup|. + * |bcid_edit_time| .. seealso:: :attr:`telegram.Game.text` @@ -4057,7 +4058,8 @@ async def edit_message_caption( Use this method to edit captions of messages. Note: - |editreplymarkup| + * |editreplymarkup| + * |bcid_edit_time| Args: chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not @@ -4132,7 +4134,8 @@ async def edit_message_media( :attr:`~telegram.File.file_id` or specify a URL. Note: - |editreplymarkup| + * |editreplymarkup| + * |bcid_edit_time| .. seealso:: :wiki:`Working with Files and Media ` @@ -4191,7 +4194,8 @@ async def edit_message_reply_markup( (for inline bots). Note: - |editreplymarkup| + * |editreplymarkup| + * |bcid_edit_time| Args: chat_id (:obj:`int` | :obj:`str`, optional): Required if inline_message_id is not diff --git a/telegram/_inline/inlinekeyboardbutton.py b/telegram/_inline/inlinekeyboardbutton.py index d88f222cad7..1225ad40f4c 100644 --- a/telegram/_inline/inlinekeyboardbutton.py +++ b/telegram/_inline/inlinekeyboardbutton.py @@ -89,10 +89,9 @@ class InlineKeyboardButton(TelegramObject): Caution: Only ``HTTPS`` links are allowed after Bot API 6.1. callback_data (:obj:`str` | :obj:`object`, optional): Data to be sent in a callback query - to the bot when button is pressed, UTF-8 + to the bot when the button is pressed, UTF-8 :tg-const:`telegram.InlineKeyboardButton.MIN_CALLBACK_DATA`- :tg-const:`telegram.InlineKeyboardButton.MAX_CALLBACK_DATA` bytes. - Not supported for messages sent on behalf of a Telegram Business account. If the bot instance allows arbitrary callback data, anything can be passed. Tip: @@ -165,10 +164,9 @@ class InlineKeyboardButton(TelegramObject): Caution: Only ``HTTPS`` links are allowed after Bot API 6.1. callback_data (:obj:`str` | :obj:`object`): Optional. Data to be sent in a callback query - to the bot when button is pressed, UTF-8 + to the bot when the button is pressed, UTF-8 :tg-const:`telegram.InlineKeyboardButton.MIN_CALLBACK_DATA`- :tg-const:`telegram.InlineKeyboardButton.MAX_CALLBACK_DATA` bytes. - Not supported for messages sent on behalf of a Telegram Business account. web_app (:obj:`telegram.WebAppInfo`): Optional. Description of the `Web App `_ that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user