Features of callback buttons
Callback buttons in Telegram are buttons under messages, when clicked, a request is made to the server of the bot that created the button. The response from the bot is shown in a pop-up window. Such buttons are also called callback buttons or alert buttons, or cb buttons (short for callback).
Due to the fact that for each click a request is sent with information about who pressed the button, the bot can respond uniquely for each user.
FLOWIN allows you to configure the automatic addition and copying of callback buttons for all forwarded messages. This allows you to implement the following scenarios:
- Automatic copying of callback buttons in messages.
- Hiding part of the text from the message in the callback button and showing it in the pop-up window only after clicking.
- Collecting statistics on button clicks for calculations within your channel, those who automatically forward or copy your content (search for pirates) or simply to analyze the activity of subscribers.
Setting up cb button generation
Before creating cb buttons, make sure that you already have a forwarding configured, where the bot account is selected as the sender.
To add a cb button, follow these steps:
- Go to the page Buttons/Cb buttons (via the menu).
- Click Add.
- Select Generating.
- Enter the label of the button.
- Set a regular expression to wrap part of the message text into the field button content (the content will be shown when the button is clicked). In this example, the last 20 to 180 characters from the text of the forwarded message will be placed in the button.
- For replacement text, specify what you want to insert into the message body in place of the moved text. In this case, the cut text from the message will be replaced with three dots.
- If necessary, specify the condition for adding a button or leave the field blank. In this example, the button will only be added to messages that contain the hashtag #story.
- It is possible to set how often the button will be added to a message: every first message, every second, every third, etc.
- If necessary, you can specify a description for the button settings. The description does not affect anything functionally and is simply for user convenience.
- Click OK.
- In the list of your forwards that appears, select forwards within which cb buttons will be added to the forwarded messages. It is IMPORTANT that the transfer has connected bot as the sender.
- Click OK.
After successfully creating, the callback button will appear in the list. Now a callback button will be added to forwarded messages according to the specified settings. In addition, within one forward you can add more than one button (in this case they will be under each other).
If necessary, by clicking on the gear you can:
- Change callback button settings.
- Select other forwards for the callback button.
- Duplicate callback button for later modification.
- Remove callback button.
Setting up copying callback buttons
Sometimes, when forwarding messages, you need to copy existing callback buttons. To do this, you need to create a setting for callback buttons in copy mode.
Before creating callback buttons in copy mode, make sure that you already have forwarding configured with the read callback buttons mode enabled, and the bot account is selected as the sender.
The button label and content will be copied from the original button, and you only need to configure the copy condition, copy frequency and description.
To add a callback button in copy mode, follow these steps:
- Go to the page Buttons (via the menu).
- Click Add.
- Select Copying.
- If necessary, specify the condition for adding a button or leave the field blank. In this example, the button will only be added to messages that contain the hashtag #story.
- It is possible to set how often the button will be copied: every first message, every second, every third, etc.
- If necessary, you can specify a description for the button settings. The description does not affect anything functionally and is simply for user convenience.
- In the list of your forwards that appears, select forwards for which you want to copy callback buttons. It is IMPORTANT that the forward has connected bot as the sender, and that the forward itself has the callback button reading mode active (enabled in the forward settings).
- Click OK.
After successful creation, the cb button copy setting will appear in the list. Now cb buttons will be copied within the selected transfers.
If necessary, by clicking on the gear you can:
- Change cb button settings.
- Select other forwards for the cb button.
- Duplicate cb button for later modification.
- Remove cb button.