Actions26
- Сообщение Actions
- Чат Actions
- Участники чата Actions
- Бот Actions
- Callback Actions
- Видео Actions
Сообщение → Редактировать
AI-generatedSummary
Edits an existing MAX messenger message by sending a PUT to /messages?message_id=… with new text, optional formatting, and optionally replacement inline buttons. Returns the API response for each input item.
Inputs
- ID сообщения (messageIdEdit) (required) — ID of the message to modify (e.g. mid.1234).
- Новый текст (newText) (required) — Replacement message text; always sent.
- Добавить кнопки (addButtonsEdit) — If on, sets inline buttons on the message. If off, the request sends an empty attachments array, which removes existing attachments/buttons.
- Режим кнопок (buttonModeEdit) — Simple (visual) or JSON. Shown only when buttons are enabled.
- Кнопки (buttonsEdit) — Simple mode: rows of buttons. Each button has text and type (callback, link, request_contact, request_geo_location, message). Callback data goes to the payload, link uses the URL, and message type uses the message text as the payload. If no buttons are defined, attachments are cleared.
- Inline-клавиатура (JSON) (inlineKeyboardEdit) — JSON mode: array of button rows, e.g. [[{"type":"callback","text":"A","payload":"a"}]]. An empty array [] removes buttons. Invalid JSON causes an error.
- Дополнительные параметры (additionalOptionsEdit) — Optional collection: text format (markdown or html) and disable link preview.
Output shape
One output item per input item, whose json is the raw MAX API response to the edit request.
The 'Добавить кнопки' toggle matters: leaving it off sends attachments: [], so existing buttons or attachments are cleared on every edit. If an item fails and Continue On Fail is enabled, the output is {error: message} for that item. Otherwise the node throws.
Examples
Example 1: Fix a typo in a bot message previously sent
ID сообщения = {{$json.message_id}}, Новый текст = corrected text, Добавить кнопки off.
Example 2: Replace a message's buttons after a user clicks one
Add buttons on, mode Simple, one row with a callback button 'Готово' (callback 'done'), plus the updated text.
Example 3: Remove buttons from a message but keep formatted text
Add buttons on, mode JSON, keyboard [], additional option format = html.