Edit Telegram Message
telegram_edit_message_textEdit the text of a previously sent bot message in Telegram. Provide the chat ID, message ID, and new text to update the content.
Instructions
Edit the text of a previously sent bot message.
Only messages sent by this bot can be edited, and only if they were sent less than 48 hours ago.
Args:
chat_id (string | number): Chat containing the message
message_id (number): ID of the message to edit
text (string): Replacement text, 1-4096 characters
parse_mode ('Markdown' | 'MarkdownV2' | 'HTML' | 'none'): Text formatting (default: 'none')
Returns: Confirmation that the message was updated.
Error Handling:
"message to edit not found" -> wrong chat_id/message_id, or the message is older than 48 hours.
"message is not modified" -> the new text is identical to the current text.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | New text for the message | |
| chat_id | Yes | Target chat. Use a numeric chat ID (e.g. 123456789 for a user, -1001234567890 for a supergroup/channel) or a public channel username with a leading '@' (e.g. '@my_channel'). If unknown, call telegram_get_updates after the user messages the bot to discover it. | |
| message_id | Yes | ID of the message to edit (returned by telegram_send_message) | |
| parse_mode | No | Text formatting mode. 'HTML' supports <b>, <i>, <a href>, <code>, <pre>. 'MarkdownV2' requires escaping special characters (_*[]()~`>#+-=|{}.!) with a backslash. 'none' sends plain text. | none |