WordPress Telegram Bot - Rules - Callbacks
Callbacks
Telegram Bot Rules
Overview | Email Repeater | Personal Messages and Group Messages | Channel Messages | SMS Repeater | SMS Alert | WordPress Repeater | Email Triggers | Keyboard Buttons | Callbacks | Menu Button & Commands
What This Rule Does
The WordPress Telegram Bot allows you to define callbacks for your telegram bot. Callback is a mechanism used in Telegram bots to handle interactive elements such as inline keyboards.
Note: this feature was introduced in version 1.1.2 of the WordPress Telegram Bot plugin.
Example of using callbacks in inline keyboard:

Setting Up

- Callback Name - Add a callback name. The name should be without spaces. The name can contain underscore "_", for example: "callback_1" or "callback_abc" etc. The callback name should be unique.
- Callback Code - Place here code or a shortcode.
You can create multiple callbacks and then use them in the Inline Keyboard.
Example
Let's create two callbacks which apply the shortcode from a third-party plugin:
- enable_map_api - This callback will enable the Map API.
- disable_map_api - This callback will disable the Map API.

Now let's head to the Keyboard Buttons tab.

Let's create an Inline Keyboard with 2 buttons.
TIP
Learn more about creating and configuring Keyboard Buttons in this guide: WordPress Telegram Bot - Rules - Keyboard Buttons
For each button here you need to define the following:
- Label - Define the text that will be displayed in the button.
- Action - Choose the action type. A few options are available, you need to choose here Callback.
- Content - Add here the Callback name which you define in another tab.

Result in Telegram:

![]() |
More information about the WordPress Telegram Bot plugin Other WordPress products can be found at CreativeMinds WordPress Store |
![]() |
Let us know how we can Improve this Product Documentation Page To open a Support Ticket visit our support center |