editMessageText
Edit the text of an existing Telegram message, including rich content, formatting, and inline keyboards. Specify chat ID, message ID, and the new text or rich message.
Instructions
Use this method to edit text, rich and game messages. 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": {
"chat_id": "<chat_id>",
"message_id": "<message_id>",
"text_or_rich_message": "<text_or_rich_message>"
},
"name": "editMessageText"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chat_id | Yes | Unique identifier for the target chat or username of the target bot, supergroup or channel in the format `@username` | |
| entities | No | A list of special entities that appear in message text, which can be specified instead of parse_mode | |
| message_id | Yes | Identifier of the message to edit | |
| parse_mode | No | Mode for parsing entities in the message text. See formatting options for more details. | |
| reply_markup | No | An object for an inline keyboard | |
| link_preview_options | No | Link preview generation options for the message | |
| text_or_rich_message | Yes | New text or rich content of the message, a string maps to the `text` parameter and an object maps to the `rich_message` parameter | |
| business_connection_id | No | Unique identifier of the business connection on behalf of which the message to be edited was sent |