Home · Blog · How to create a bot in MAX
How to create a bot in MAX
MAX is younger than Telegram: there are few instructions, and the official documentation is written for developers. At the same time, the scheme for launching a bot is no fundamentally different: you register the bot on the platform, receive a token, connect it to the “brain”, which responds to messages. In CHBT, such a brain is a script made of blocks, and MAX is one of the project channels next to Telegram, VKontakte and the widget. Below is the full path: from the “MAX for Business” account to checking on the phone, with an emphasis on how MAX is different and what needs to be changed in the flow because of this.
What you need in advance
Three things without which you can’t go further.
- MAX account. The application is installed, the number is confirmed. From this account you will log into your business account and then test the bot from it - it’s convenient to have a second number or a colleague to check “through the eyes of the client.”
- Office "MAX for business" — business.max.ru. This is where bots are created and tokens are issued. One office per company; if there are several bots, they all live in it.
- Project in CHBT. Register for app.chbt.io by email and password, then “Create a bot”. In terms of CHBT, a “Bot” is a project: channels are connected to it, and one script works in all of them. On the Free plan, one project, 30 conversations per month and all channels without restrictions by type - MAX included.
If the bot is already working in Telegram, a separate project for MAX is not needed: the channel is added to the existing one, the same script is picked up. If MAX is the first channel, start with an empty project.
Step 1. Register the bot in MAX for business and receive a token
Log in to business.max.ru using your MAX account and create a bot. The platform will ask for a name, avatar and a short description - what the client will see in the bot card before the first message. Write the name as the name of the business, without the word “bot”: “Dentistry Smile”, “Sakura Delivery”. Description - one or two phrases about what the bot can do: “I’ll make an appointment, remind you about the visit, answer the prices.”
After creation, the bot will appear on the page token — a long string with which CHBT will be presented to the platform on behalf of the bot. The rules for handling it are the same as for any secret: do not send it to chats, do not leave it in screenshots, do not store it in notes. The only destination is the Token field in the Channels section of CHBT. If the token still ends up in the wrong place, it can be reissued in the MAX account; the old one will then stop working, and the channel in CHBT will have to be reconnected.
The wording of the items in the MAX account changes from version to version, so be guided by the meaning: you need a section about bots and in it there is a line with a token. If your account asks about a webhook or an address for notifications, you don’t need to fill in anything: CHBT will set up a subscription to events itself upon connection.
Step 2. Connect the channel to CHBT
In the project, open the section “Channels”. Among the channel cards, find MAX and click "Connect MAX". Two fields: “Channel name” - for yourself to distinguish channels in the list, and “Token” - a string from the MAX account, in its entirety and without spaces. Click "Connect".
Then CHBT does what would take an evening to develop on its own. First, it checks the token: it asks the platform for bot data - if the token is incorrect, you will immediately see the “Error” status and the text “Invalid MAX token or API is not available.” Then subscribes to the bot’s events: reports the MAX address https://app.chbt.io/webhook/max/ID_канала, where the platform will send every incoming message, button click and the fact that the bot is opened. No server or domain on your part. If the subscription is successful, the status will switch to “Working”; if the “Channel name” field is left empty, the name of the bot from MAX will be substituted into it.
If something went wrong, in the channel table under the status in small text there will be a reason - the platform’s response. Button “Reinstall webhook” button repeats the subscription with the same token: useful if the subscription fails. The token in an existing channel cannot be edited: when changing the token, the channel is deleted using the “Delete” button and reconnected. Contacts are not lost in this case - they are tied to the project and MAX user ID, and not to the channel. The correspondence of the deleted channel will remain in “Conversations” for reading, and when the client writes again, the conversation will open in a new channel. The short version of this step is in MAX connection help.
How MAX-bot differs from Telegram: five features for the flow
One flow covers all channels, but some Telegram habits don't carry over to MAX. It's better to account for them before you start editing texts.
- The first-message rule. A bot in MAX can't message a person who hasn't opened a conversation with it. Until the client taps “Start” or writes first, there is no recipient for messages — not for CHBT, not for anyone. You can't upload a list of phone numbers and send “we're on MAX now”. Your list for broadcasts and reminders equals the list of people who have already messaged the bot. How to set up notifications with this rule in mind is covered in the article on service notifications via a MAX bot.
- Opening the bot is already an event. When a person opens the bot for the first time and taps “Start”, MAX sends a start event, and CHBT handles it as
/start. So the “Command /start” trigger in the flow also fires in MAX — no separate trigger is needed. If the bot was opened via a link with a parameter, the parameter arrives in the same event and is caught by the “Deeplink” trigger. Check the format of such links in the MAX for Business documentation — CHBT QR campaigns currently build deep links only for Telegram. - Buttons go below the message, one per row. In the MAX channel, CHBT shows “Message” block buttons below the text the same way as in Telegram: each on its own row, up to 30 buttons. There are two types: go to a flow branch, and a link. There's no persistent menu under the input field. In practice: use one- or two-word labels (“Book”, “Prices”, “Address”), and repeat the start menu at the end of long branches — otherwise the person has to type to get back.
- Text and buttons only. You can't send photos, PDFs or videos in MAX through CHBT. Share a price list as a link in the text, and directions as a map link.
- No “typing” indicator. In the Telegram channel CHBT shows it while preparing a reply; in MAX the reply appears at once. With long messages the delay before the text appears is noticeable, so split messages into two or three short ones.
Limits on outgoing message rates are set by the platform. Flow replies aren't affected, and CHBT sends broadcasts through a throttled queue — but if your audience is large, split a broadcast by tags into several parts.
Step 3. First flow: template and edits for MAX
Open the “Flows” section, create a flow and click “From template” in the editor. Three templates make a good start for MAX: “Appointment requests” — service via buttons, time as text, phone; “Autoresponder FAQ” — keywords about prices and hours, everything else goes to an operator; “Consent to the newsletter” — if the main goal is to build a list of people you can message later. The template unfolds into blocks: the “Command /start” trigger, a “Message” with buttons, “Data collection” with format validation, and an “Action” that notifies you.
Now the MAX adjustments, following the list from the previous section.
- Shorten the greeting to two or three lines, and replace the template's service buttons with your own.
- At the end of each branch add a “Message” block with a “Back to start” button — it replaces the missing menu.
- Give links to the price list, map and policy as a “Link” type button, not as text: it's easier to tap on a phone.
- Add an “Any message” trigger that returns to the menu: it will catch people who write “hello” instead of tapping “Start”.
- If the same flow also runs in Telegram and you want different texts, add a “Condition” block on the channel: the “MAX” branch gets a short text, the “otherwise” branch the full one. This technique is covered in detail in the article about one flow for MAX and Telegram.
On the Free plan the editor works in “Steps” mode — a linear list of blocks; on Basic the “Canvas” with branches and arrows becomes available. Changes are saved automatically, and the “History” button (version history) rolls back bad edits. The last and mandatory step: enable the flow. The flow card shows an “Enabled” or “Draft” badge with a toggle next to it — the same toggle is on the “Overview” page; a new flow and a copy made with the “Duplicate” button are created as drafts.
Step 4. Test the bot: test chat and phone
First in the editor. The “Test Script” button opens a test chat next to the diagram. Go through all the branches, click each button, enter the phone number with an error and make sure that the bot asks you back with your text and not the standard one. The test chat works without a connected channel and is conducted on behalf of the “Test” service contact; It is not included in the monthly conversation limit. Catch the logic here.
Then in MAX. Find the bot in the application by name or open its page from the MAX for business account, click “Start”. The greeting should come within a second or two. Click the go button and the script should continue; Click the link button and the browser should open. Go to the phone collection, leave the number.
Then in the office CHBT. In “Conversations” - correspondence with the mark of the MAX channel; in “Contacts” - a card with the name from the MAX profile and phone number; by mail - a letter about a new lead, if notifications are enabled in “Account → Notifications”. If the script ends with the “Operator” block, respond from “Dialogs” and check that the answer came to MAX.
Required last test - from a second device or a colleague’s account. You know where to click; In a minute, an outsider will find a thread where the text breaks off or the button leads to the wrong direction. Remember that on the Free plan, each new interlocutor in MAX, including your second account and your colleague’s account, is one of 30 conversations of the month.
If the MAX bot is silent
The reasons are almost always the same as for any bot on CHBT, plus two specific to MAX. Go from top to bottom.
- In “Channels” the status is “Error”. Read the text under the status. “Invalid MAX token or API is unavailable” - the token was not copied in its entirety or was reissued: delete the channel and reconnect with the current one (correspondence of the deleted channel will remain in “Dialogs” for reading, contacts too). Subscription error - click “Reinstall webhook”.
- Status “Working”, but there is silence on “Start”. The script is in draft (turn it on with the switch on its card) or it does not have the “Command” trigger /start".
- Responses to start, but not to regular text. There is no “Any message” trigger, and the word did not match any key.
- Answers with a phrase about the conversation limit. There were already 30 interlocutors per month on the Free plan, and the bot sends a short stub to new people instead of a script, and those who have already written this month receive answers as usual. Check the "N of 30" counter on the bot's "Overview" page. The solution is to wait for the new month or Basic for 650 ₽ per bot per month.
- The newsletter does not reach part of the base. People blocked the bot or never wrote to it - MAX does not allow them to write first. In mailing statistics this is the “errors” line; no need to clean with your hands.
- The bot responds, but with a delay of several seconds on long messages. This is not a breakdown: MAX does not have a “printing” indicator. Break the text into short messages.
A short checklist for bookmarking is in the help “MAX bot is silent”. If the bot's task is to answer incoming questions outside of working hours, look at the analysis of of the answering bot in MAX: there is a condition for the time of day and transmission to the operator.
One project - MAX and Telegram together
The script you just put together for MAX answers unchanged in Telegram: in “Channels” you add a token from @BotFather - and the same bot works in both messengers. Contacts from both channels are collected in one “Contacts” with a channel mark, correspondence - in one “Conversations”, requests - in one CRM. The price is per project, not per channel, so the second messenger does not add anything to the bill. How to register a bot in Telegram and what to configure there with BotFather is described step by step in the article how to create a Telegram bot.
When should channels be divided into two projects: if the audiences are fundamentally different (retail in MAX, partners in Telegram) and the flows do not overlap, or if you need separate teams of operators. In other cases, one project is simpler: one script edit - and it’s in both channels at once.
In total, it takes an evening to create a bot in MAX: half an hour in the MAX business account, five minutes in “Channels,” an hour to edit the template, and half an hour to check from two phones. Create a bot in MAX for free →
Bot constructor MAXHelp: connect MAXRegistering clients in MAXNotifications to clients via MAX botMAX or Telegram: where to run the bot