How to manage Commands in @MenuBuilderBot

How to manage Commands in @MenuBuilderBot

MegaHubTelegram


The @MenuBuilderBot constructor allows you to interact with your bot using commands. Commands are assigned to the buttons of the lower menu, which allows you to use them on their own, as well as to create inline keyboards.


📜 The translation of this materials into your native language can be automatically done using the Google translator. Follow the link and select the desired language in the title:
https://translate.googleusercontent.com/translate_c?depth=1&sl=en&tl=es&u=https://telegra.ph/How-to-manage-Commands-in-MenuBuilderBot-EN-02-26



⬛ What are commands


In Telegram, commands are the sort of a hotkey for some functions. The syntax of the commands in Telegram is: any English word starting with “slash”.
For example: /command

All messages in your bot must be added to some button of the lower menu. Thus, to display the message to the user, you must click the appropriate button. @MenuBuilderBot allows you to assign a command to any lower menu button in your bot.
When the user sends a command to the bot, @MenuBuilderBot shows him all the messages assigned to the corresponding button. The inline keyboard, in its turn, connected to the lower menu through commands.
Thus, the commands in @MenuBuilderBot, basically, is a way to remotely click on the buttons of the lower menu, which allows you to create bots without a menu at all, or use an inline keyboard with commands to interact with the user.

Summarizing all mentioned above: Any command you create in @MenuBuilderBot should be bound to some button on the lower menu. You can call this command (thereby referring to the content or functionality of the button) by sending this command to the bot directly, or by creating an inline button with this command.


⬛ Bot commands


Bot commands are sent directly to the chat with the bot. In general, Command consists of a Name, Parameters and Arguments. For you it means that command can contain additional parameters such as telegram ID or UserCode of the user, text or numbers.

The list of commands available initially for everyone can be found in HOW TO.

Some functions have their own commands - these commands are listed in the manuals for the respective functions.
For example: Variables manual, Captcha manual, QnA Chat manual, Turbo Mode manual, and other.


The list of commands that are not belong to particular functions

The commands that are not belong to particular function (bot's commands) we will be adding here:


Сommand that displays all the information available on user. Instead of the Telegram ID of the desired user, you can use his UserCode.

IMPORTANT: Command consumes 5 Tokens of Functions.


The command will enable or disable checking of conditions on all buttons for ALL admins of your bots. Affects the WHOLE bot entirely. The setting does not affect users. It is needed mainly for certain tests and the convenience of navigation in certain cases.


⬛ Buttons Commands management


To manage commands, go to the «Button Editor»:


Specify the desired button by clicking on it and open the Button Settings (* ⃣):


Click on the «Assign command» button:

The appearance of the button's "Settings Menu" and the number of options may vary depending on the purchased extensions and plugins.


You will get the command assignment interface:

If any command has already been assigned to this button, you will see it here in the message (1).

In order to create a new command, you need to write it in the text box (2) and send it as a message to the bot.

❗️ The command must begin with the “/” (Slash) character and may contain only:

• Latin letters

    • Numbers

    • Symbol “_” (Underscore).


For example:

   /help

   /message1

   /buy_01


If the command you have sent to the bot is correct, you will see a confirmation message:

After adding a command, some additional buttons appear in the interface.


By default, commands are only displaying the messages of its button. If, in addition to displaying the messages by command, you need to transfer your user to the corresponding menu, switch the "Move by command" setting. The current state of the transition settings is displayed on the button itself. If active, your user will be transferred to the menu of the button whose command he send to the bot.


To delete some previously created command, use the «Delete command» button.

To finalize the creation of a new command, click "Confirm".

Click "Cancel" if you change your mind to add or modify an existing command.


To complete the creation of the command, click “Confirm” and exit the “Button Editor”. To use the command, just send it to the bot:


That's all about command management in @MenuBuilderBot, see a bit of additional information below.



⬛ Additional Information


The constructor allows you to create bots without a lower menu – bots controlled only by commands or inline keyboard.

There is currently no way in @MenuBuilderBot to add commands without lower buttons. However there are 2 ways to hide buttons with commands.

Method 1: Switch the button to “Admin Only” mode. This will hide the button from users, however, it will make it impossible to utilize “Move by command” option and navigate through such a menu using commands. Since such a button and all its menus will be “admin only” and therefore forbidden for the user. However, the messages of such a button can still be displayed via command. See here: "How to make a button visible only to admins?"

Method 2: Make your button Invisible. This will also hide it from users, however, unlike the admin buttons, navigating through such a menu using commands will remain possible. Read more about “Invisible Buttons” in the help bot.

☝ Hint: If you need a lot of hidden buttons – create one “admin only” or “Invisible button” and add buttons with commands inside of it. All inside buttons will inherit the attribute and will not be visible to the user as well.

Method 3: Create an inline keyboard and access the buttons of the lower menu using the inline button with command. Read more in Inline buttons guide.


The bot allows you to see all existing commands and view the buttons containing them.

Use the command:

Just send this command to your bot to see the whole structure of the bot’s menu.



https://telegra.ph/Menu-Builder---All-Help-Materials-02-22

Report Page