Edit Message Text 🔽
Rewrite a Telegram message instead of spamming a new one
- bot
- trigger
- message
- message_id
- trigger
Edit Message Text exists because nobody wants to receive forty "step 3 of 40" messages. Send a single status message, then keep rewriting it in place as the workflow progresses - same message, same message_id, updated text. For any long job you're monitoring from your phone, this is the difference between a chat that looks like a notification firehose and a chat that has one tidy progress line. It's part of the pack's "edit" category, alongside nodes for editing image, video, and audio messages.
How it works
It's a single call to Telegram's editMessageText method. Instead of a fresh message, you hand it the message_id of an existing message (plus the chat_id it lives in) and the new text. Telegram replaces the content of that message in place; the response is the updated message object. Nothing clever, but it's the API's own mechanism, so it works reliably with messages sent by any node in this suite - you just keep the message_id from a previous Send Message output and wire it in.
Inputs
bot- TELEGRAM_BOT instance from the Telegram Bot node.chat_id- the chat the original message is in.message_id- the message to rewrite. This is where you wire themessage_idoutput of a Send Message, Send Image(s), or Send Video node. Only the lastmessage_idis returned by those senders, so chain: send once, edit that same id repeatedly.text- the replacement text, 1 to 4096 characters.parse_mode- None / HTML / Markdown / MarkdownV2, for formatting the replacement.
Outputs mirror the send nodes: message (DICT), message_id (INT - same id, conveniently, so you can keep the chain going), and trigger.
The progress-line pattern
The classic setup is two branches off one Send Message: the send node posts "Generating…" and outputs its message_id; Edit Message Text consumes that message_id and a new text string. If you have multiple stages, you can cascade edits. The catch is execution order - an edit must not run before the send that created the message. That's exactly what the trigger passthrough is for: wire a signal through the edit node so it's forced to run at the right point. Read the Send Chat Action article for the full trigger explanation; the short version is that the trigger output feeds a downstream dependency to pin the edit's position in the graph.
Install and gotchas
Pack install, same as every node here:
cd ComfyUI/custom_nodes
git clone https://github.com/SwissCore92/comfyui-telegram-suite.git
cd comfyui-telegram-suite
pip install -r requirements.txt
Config and restarts are shared across the suite. The two things that will bite you: Telegram only lets you edit a message for 48 hours after it's sent, so a very long workflow can outlive its own message. And the edit target must actually exist - if your send node never ran (say, because ComfyUI skipped a branch), editMessageText fails with Telegram's "message to edit not found" error. When that happens, look at what's upstream: the edit probably fired before the send, and that's an ordering problem, not a Telegram problem.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| bot | TELEGRAM_BOT | Telegram bot instance | |
| chat_id | INT | Unique identifier for the target chat | |
| message_id | INT | Unique Identifier of the message to edit | |
| text | STRING | Text of the message to be sent, 1-4096 characters after entities parsing | |
| parse_mode | COMBO | Mode for parsing entities in the photo caption. See https://core.telegram.org/bots/api#formatting-options for more details. | |
| triggeropt | * | Optional trigger to enforce execution order |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| message | DICT | — |
| message_id | INT | — |
| trigger | * | — |