Skip to content

Commit c16e264

Browse files
Introduced the ability to add media to existing text messages using the method editMessageMedia
1 parent be047fc commit c16e264

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

telebot/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4969,10 +4969,11 @@ def edit_message_media(
49694969
business_connection_id: Optional[str]=None,
49704970
timeout: Optional[int]=None) -> Union[types.Message, bool]:
49714971
"""
4972-
Use this method to edit animation, audio, document, photo, or video messages.
4973-
If a message is a part of a message album, then it can be edited only to a photo or a video.
4974-
Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
4975-
Use previously uploaded file via its file_id or specify a URL.
4972+
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages.
4973+
If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise.
4974+
When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL.
4975+
On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
4976+
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.
49764977
49774978
Telegram documentation: https://core.telegram.org/bots/api#editmessagemedia
49784979

telebot/async_telebot.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6405,10 +6405,11 @@ async def edit_message_media(
64056405
business_connection_id: Optional[str]=None,
64066406
timeout: Optional[int]=None) -> Union[types.Message, bool]:
64076407
"""
6408-
Use this method to edit animation, audio, document, photo, or video messages.
6409-
If a message is a part of a message album, then it can be edited only to a photo or a video.
6410-
Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded.
6411-
Use previously uploaded file via its file_id or specify a URL.
6408+
Use this method to edit animation, audio, document, photo, or video messages, or to add media to text messages.
6409+
If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise.
6410+
When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL.
6411+
On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.
6412+
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.
64126413
64136414
Telegram documentation: https://core.telegram.org/bots/api#editmessagemedia
64146415

0 commit comments

Comments
 (0)