Telegram widgets and private replies
Configure Telegram widgets, handle selections and send private reaction replies.
Sur cette page
Reactions can send interactive widgets, handle selections and reply privately to a command or button. The editor shows these features when they are enabled for the project and an appropriate Telegram channel is selected.
Lesson 1. Create a choice widget
- Connect a Telegram bot and open its project. Create a reaction for a command such as
choose. - In Send message, select Add block → Telegram widget. Enter a title and optional text.
- Add options with visible labels and unique event data such as
yesandno. Use one to eight options; each data value can contain at most 64 UTF-8 bytes. - Save the block and reaction. Send the command to the bot in a private Telegram chat and try the selection on a device.
Lesson 2. Handle a selection
Create another reaction with the Telegram widget event trigger. Enter the desired option data, or leave it empty to match any selection. Add the reaction actions and save. Select an option in the sent widget and check the result.
Answer Telegram widget returns data to the widget. Place it immediately after the necessary calculations: the wait is limited to two seconds, after which the answer may be empty. Update Telegram widget data changes the originating widget; an empty value clears the selected field. Each field is limited to 1024 UTF-8 bytes.
Shared and forwarded widgets
Enable Shared widget when the same public data should be visible to all recipients. Do not put private information in public data. To resend a widget, select one previously created by the same bot and channel.
Forwarded widget handling is a separate option. Telegram does not provide the forwarded widget's chat, so chat type and ID restrictions do not apply to that event and per-chat data is unavailable. Only public data can be updated from it.
Lesson 3. Send a private reply
For a button that invokes a reaction, open the target reaction and enable the private reply option in its send action. The reply is intended for the person who pressed the button and must not become an ordinary group message. A private command can be registered in the Telegram bot's command settings.
Use one block in a private reply: text or one supported media file, including audio or video. Test with a dedicated bot and a real user. If the button or message context is missing or expired, the reply is not sent publicly.
Audio, video and quotes
The send action includes separate Audio and Video blocks. Upload a file to the media library or choose an available Telegram file_id; use exactly one file for a private reply. Formatted message quoting applies to ordinary Telegram replies and cannot be combined with a private reply.
Widgets in operator conversations
A delivered widget appears as a separate card containing its HTML and latest confirmed data. Successful data updates refresh the card. Public data for a shared widget updates its recipients within the same Telegram channel; chat data belongs only to the particular recipient.
The preview is read-only: its buttons do not trigger reactions. It shows saved state, not a device screenshot or proof that the message was read. A widget response that Telegram does not persist as message data, and client-local state, may differ. When a confirmed snapshot is unavailable, the card says so.
Pressing a button again may send identical data to Telegram. The message is not modified response to an edit is treated as a successful action with no changes. In an older history entry, this response means that the message already contained the requested text and buttons.
Troubleshooting
- Widget or private reply is missing: check the selected channel and the project's feature availability.
- A selection does not trigger a reaction: check the trigger, option data, chat scope and whether the reaction is enabled.
- A shared widget cannot be selected: confirm it was created in the same project and channel.
- A forwarded event cannot update chat data: Telegram does not provide its chat context; use public data.
See also reactions and messages and buttons.