Replacing text on buttons in Telegram without resending

Replacing text on buttons works only on Telegram.

You can replace text on the buttons with sending new screen using Telegram API request with editMessageReplyMarkup method,

Make screens in the builder as follows

Let's take a closer look:

1. Add Buttons. All buttons are to transition to Request.

2. Fill Request.

Method — POST.

Request URL:

https://api.telegram.org/bot123456789/editMessageReplyMarkup

Where 123456789 is to be replaced with your bot token.

Add Request body:

{
"chat_id": "{{this_user.platform_id}}",
"message_id": "{{last_telegram_message_id}}",
"reply_markup": {
          "inline_keyboard": [
            [
              {
                "text": "3",
"callback_data": "{\"value\": \"kn3\"}"
              },
{
"text": "4",
"callback_data": "{\"value\": \"kn4\"}"
}
            ]
          ]
        }

In the Request body text variable is set to “3” and “4”.

"text": "3"
"text": "4"

That is why when the user presses button 1 or 2 in the original screen the text is replaced with 3 and 4.

You can set text to whatever the text you want to replace button text with.

3. In the same screen, after Request, add Forward with the checkbox Pause bot after forward till next user message. Forward will take the user to the next Fork screen.

4. Add a Fork, to check which button the user pressed.

To do so, add lastUpdate.update.data.value variable to The variable name from which the fork will take the value.

Make a Fork Target which will respond to possible user values.

In our example, the values kn3 and kn4 are checked, as we have specified them in the request body. You can change the values to whatever you wish as long as these values are the same in the Request and in the Fork.

5. Add Request component to the screens where the user will be taken after the Fork.

Request method is POST and request URL are unchanged, as in “Screen after buttons”.

When the user is in these screens, the text on the buttons from the bot will to the text again that is in the "text" variable of the request body.

To the beginning ↑