Skip to main content

Secretary Bot - basic working logic

In this guide we will tell you in detail how to create your own Business Bot using the @MenuBuilderBot constructor.

At this stage, a fee of 1 Token of Group is charged for the operation of one Business Bot, in all other aspects these bots are created and operate on a general basis. The monetization model may change in the future.

NOTE: The Secretary Bots (formerly Business Bots) feature was added to the constructor almost immediately after its release in Telegram. At that time, we weren't sure how much interest this feature would have. Therefore, we implemented it in the simplest possible way - using the constructor abilities itself. If Secretary Bots generate interest, we will continue to develop this feature. It is currently in its infancy stage.

Peculiarities of work

Secretary bots created using the @MenuBuilderBot constructor - in their basic form - are implemented by creating simple and intuitive Lower Menu functionality. You create lower menu buttons and messages, and the user, without seeing them, interacts with them indirectly - through instructions that you can provide in messages themselves, specifying commands or keywords.

However, interacting with the lower menu in Secretary Bot mode has its own features and limitations:
 ● Buttons in the «Admin Only» mode are only available to users by commands.
 ● «Invisible» buttons are available by name.
● It is recommended to write the names of menu buttons in LOWER case (see explanation below).
● Commands in messages of private chats are NOT displayed - it is advisable to make them copyable.
● Error message (Unknown command) - is not shown.
● No functionality except messages works.
● Inline buttons and the lower menu are not shown.
● Forms (questions) do not work.
● Buttons closed by Condition and buttons with functionality (Actions, Bonuses, etc.) are ignored.

IMPORTANT: All messages sent by the user are forced to lowercase. Therefore, the names of the Business Bot menu buttons must also be written in lowercase. In this case, it will not matter how the user wrote this or that word - the bot will be able to process it correctly.

Creating business bot logic

Connect your bot to the MenuBuilderBot bot constructor

In order to create Business Bot logic on the  @MenuBuilderBot constructor, your bot must be added as a Menu-bot.

How to add your bot to the constructor is described in the guide «Create a New Bot».

Creating Bot Responses

In the MenuBuilderBot constructor, creating a Business Bot is similar to creating a Menu-bot. They differ only in that the Business Bot works indirectly through personal chats, but in fact, the same commands and menu buttons are accessed as in a regular Menu-bot. Thus, if you have mastered the basic mechanics of working with the Menu bot, you will not have any difficulties in creating a Business bot.

As we write this guide, we assume that you already have an idea on how to ​​create a Menu-bot. 
If this is not the case, then first familiarize yourself with the basic features:
Creating buttons
Adding messages
Commands
Formatting text in Telegram

Approach 1

The Business Bot responds to the user only by commands and words that he "knows".

This is the simplest option, both in the aspect of creating a bot and in its capabilities. It is most suitable for beginners in working with the constructor, for creating bots with simpler logic, and also if you are more likely to expect information from the user, rather than assume that the bot will lead the user according to a rigid scenario.

To create such a bot, add several buttons to it, the names of which can serve as keywords to the information they contain. Add the corresponding messages to the buttons.

For example :
 The «Schedule» button may contain a message with your work schedule.

Thus, if the user sends the word "Schedule" in the personal chat, the bot will respond with the message specified in this button.

In Business Bot mode, all user messages are CASE-INDEPENDENT. That is, for the bot it does not matter whether a word is written with a capital letter or a lowercase letter.

In order to initially inform the user on Keywords or Commands available to him, you can use the "Greeting Message". To set a greeting message: 
1. Go to your account Settings
 2. Click «Telegram for Business»
 3. Select «Greeting Message»
4. Set the message itself and indicate the desired keywords in it.

When creating a Greeting Message, you can also specify how often it will be displayed.

Approach 2

The Business Bot, using Keywords or Commands, guides the user through a given scenario, responding with a default message to ANY unknown message from the user.

Use this approach if you want to STEP-BY-STEP guide your user, through the information you need, at the same time it is not implied that the user will write something by himself - because the bot will always respond with a default message, to any unknown user's responses.

Creating bot responses is done in a similar way - as described above - using buttons and messages. We will not dwell on this separately.

In order to set a "default" message that will be shown to the user in response to any unknown command (and return him to the beginning of the script), you need to purchase an extension for customizing messages and, in particular, the unknown message (Error Message).

« 33. Custom Messages»
To connect, go to your bot:
☞ 🔐Admin | 🧩Extensions | 📂Customization

Then set up the error message command:
☞ 🔐Admin | 🎚Bot Customization | 🚯 Wrong Command Message

1. Set your error message (without it, adding a command option is not available) 
 2. OPTIONAL - click «Do not show message» to enable this option (enabling it will prevent the bot from showing the standard error message if the command is set).
3. Set the command itself (for example /main).

IMPORTANT: System commands like /start and /home do not work in the Business Bot.

Now if the user sends the bot an unknown command or a message to which the bot has no answer, the bot will call the command specified here.

In order for the command to work, you need to create a button with this command (/main) and add a message to it that will be the beginning of your script and contain the Key Words or Commands necessary for the user to start communicating with the bot.

For information on how to add a button command, see the Guide on Commands.

To create a consistent scenario, each subsequent message must contain Key Words or Commands that will allow the user to choose the further direction of the dialogue with the bot.

❖ Additional information

If desired, the menu buttons can be hidden in two ways.

1. Switch them to the «Admin Only» mode, in which case the button message will be available only by command if it is set for this button. 
 2. «Invisible Button» mode - in this case the button message will be available both by its name and by command if it is added.

The Invisible Buttons functionality is available in Extensions and is added separately.
«36. Invisible Buttons and Messages»
To connect, go to your bot:
☞ 🔐Admin | 🧩Extensions | 📂Buttons

Design of Keyword and Commands

Since commands in private chats are not displayed as commands and cannot be clicked, for the convenience of the user it is advisable to highlight the desired Keyword and Commands as copied text.

For information on formatting text in Telegram, see the markdown guide.