Telegram (Grammy) [Stage] icon

Telegram (Grammy) [Stage]

Send and manage Telegram messages, chats, and files via Grammy

Actions10

Message → Edit

AI-generated

Summary

Edit a previously sent Telegram message by updating its text and optionally reply markup or entities.

Inputs

  • botToken (required) — Telegram bot token (must be provided, usually passed from previous node).
  • chatId (required) — ID of the chat containing the message.
  • messageId (required) — Numeric ID of the message to edit.
  • text — New text for the message (optional).
  • replyMarkup — Inline keyboard markup (JSON string or object) to replace existing markup.
  • entities — Formatting entities for the new text (JSON string or array).

Output shape

Telegram message JSON object returned by editMessageText

Returns the edited message object; on failure with continueOnFail enabled it may return {"error": }.

Examples

Example 1: Edit a message's text and replace its reply markup

botToken: token, chatId: 12345, messageId: 67, text: "Updated", replyMarkup: {"inline_keyboard":[[{"text":"Edit"}]]}

Example 2: Edit only formatting of a message without changing text

botToken: token, chatId: 12345, messageId: 67, entities: [{"bold":true,"offset":0,"length":5}]

Example 3: Delete a message using edit operation (fallback to delete)

botToken: token, chatId: 12345, messageId: 67, text: "" (ignored), operation: edit

Links

Discussion