Telegram Bot icon

Telegram Bot

Interact with the Telegram Bot API – send messages, manage chats, handle payments, and more

Actions101

Message → Edit Message Media

AI-generated

Summary

Edit the media content of an existing message in a specified Telegram chat by providing the chat ID, message ID, and a new InputMedia JSON object describing the media to replace.

Inputs

  • Chat ID (required) — Unique identifier for the target chat or username (@channelusername).
  • Message ID (required) — Unique identifier of the target message to be edited.
  • Media (JSON) (required) — JSON InputMedia object specifying the new media to replace the current message media.

Output shape

a single record containing the edited message object returned by the Telegram Bot API

Returns the edited message object on success, parsed from the Telegram API response's 'result' property.

Examples

Example 1: Edit a photo in a Telegram chat message by specifying the new media JSON to replace the old media.

Provide the chat_id, message_id of the message to update, and the edit_media JSON object describing the new media content.

Links

Discussion