editMessageMediaInline
Edit or replace media in an inline Telegram message using a file_id or URL, with optional inline keyboard updates. Supports photos, videos, documents, audio, and animations.
Instructions
Use this method to edit animation, audio, document, live photo, photo, or video inline messages, or to replace a text or a rich message with a media. 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, a live photo, or a video otherwise. 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. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned. 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"inline_message_id": "<inline_message_id>",
"media": "<media>"
},
"name": "editMessageMediaInline"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| media | Yes | An object for a new media content of the message | |
| reply_markup | No | An object for a new inline keyboard | |
| inline_message_id | Yes | Identifier of the inline message | |
| business_connection_id | No | Unique identifier of the business connection on behalf of which the message to be edited was sent |