Create and edit commands
Create and edit bot commands, answers, aliases, groups, folders, and BJS in the current Bots.Business command editor.
A command defines what your bot does when it receives matching text or when another part of the bot runs that command. It can send an Answer, show a keyboard, or execute BJS.
Create a command on your phone
Open your bot → Commands.
Tap + → New command.
Enter Command, such as
/help, and Answer, such asChoose a topic from the menu.Tap Create. For an existing command, use ⋮ → Options to open Edit metadata, then tap Edit after changing its fields.
Launch the bot if needed and send
/helpin Telegram.
The editor's code area contains BJS. Save writes the current metadata and code. If you navigate away with unsaved changes, handle the save prompt before assuming your changes are active.

What the fields do
Command
The command text, usually /start, /help, or a short internal name.
Answer
A message sent when the command is triggered.
Aliases
Alternative names, separated by commas: Help, /support.
Help
A description used by the bot's help behavior.
Keyboard
Reply-button labels separated by commas; \n starts another row.
Allowed only for group
Restrict execution to a named Bots.Business user group.
Wait for answer
Send the prompt first and run the BJS after the user's reply.
Auto retry time in seconds
Run BJS periodically without user/chat context. Follow the complete Auto Retry setup, including an explicit destination and how to stop it.
Select Folder
Organize the command in the app; a folder is not a permission group.
A Keyboard requires an Answer in the metadata form. An auto-retry interval requires BJS. The editor reports these combinations when you save.


Names, aliases, and parameters
Use consistent lowercase command names such as /help. Main command names are matched exactly, so /start and /START can differ. Aliases are trimmed and normalized to lowercase; they provide a convenient way to connect a button labelled Help to /help.
For a command /product, an incoming /product blue can expose blue as BJS params. Define the /product command, then handle the parameter in its code. Avoid conflicting command names and aliases.
The special commands *, @, @@, and ! have runtime roles. Read execution context and special commands and BJS errors before using them.
Format a simple Answer
Answer messages use the Telegram sender's default Markdown formatting. Start with ordinary text, then add simple formatting:
Unmatched formatting characters can cause a Telegram error. A Markdown link to an image is a link; it is not a reliable replacement for sending a photo. Use a suitable Telegram API method when you need a photo, document, or explicit parse mode.
Put a saved property in an Answer
An ordinary Answer can include a stored property as <property_name>. For example, create /remember-color with empty Answer, Wait for answer off, and this BJS:
Create /my-color with Answer Your color: <favorite_color>, empty BJS and Wait for answer off. Send /remember-color, then /my-color: expect Your color: blue.
The placeholder looks first for this user's property in this bot, then for a bot property with the same name. A missing property becomes an empty string. Use simple text or numeric values, and check how formatting characters in a value affect the final message.
This is Answer property substitution, not HTML formatting. Do not use <b>...</b> in an ordinary Answer to make text bold; use its Markdown syntax, or an explicit Telegram API parse mode. SmartBot's {placeholder} templates have their own rules.
Restrict a command to a group
The group field refers to a Bots.Business user group, not to a Telegram group chat. Assign group membership through User methods, then put that same group name in the command's Allowed only for group field. A command without a group restriction is not restricted by this field.
Find and organize commands
Use search, folder selection, and feature filters such as Has code, Has keyboard, or Wait for answer. If a command appears to be missing, clear search and filters before recreating it.

Editor tools
Open ⋮ to find Check and Format. Options opens the command metadata. Close the menu to use Save at the bottom of the editor.
Check checks syntax. It does not prove that an API method exists or that a request will succeed.
Format formats the current code draft; save the result when ready.
Search code opens find and replace within the current command.
Undo and Redo work on the current editor draft.

Next: reply keyboards, collecting input, background work, or importing commands.
Last updated
Was this helpful?
