Home · Blog · A VK Community Bot: From Connection to Your First Flow

A VK Community Bot: From Connection to Your First Flow

· updated · Command CHBT · VK

A VK community is an audience you have already built: people have subscribed, see your posts and message the community with questions like “how much is it?” and “are you open on Sunday?”. A bot answers these messages instead of the administrator, collects leads and hands the tricky cases to a human. Connecting takes a couple of minutes and needs no code: in the community you turn on messages and bot features, in CHBT you click “Connect via VK”, and CHBT sets up the Callback API by itself. Below is the whole path: what to enable in the community, how to connect it with the button or with a key, how to build your first flow and how a VK bot differs from a Telegram bot.

What the VKontakte bot does - and what it doesn’t do

The bot in CHBT works in community messages: a person opens a conversation with your group or public, writes - the bot responds on behalf of the community. This is the same conversation that the administrator is currently conducting, only the first line is taken by the script.

Typical tasks that are completed in the first week:

  • answers to recurring questions - prices, address, schedule, availability - using keywords or buttons;
  • collection of leads: name and phone number in the “Data collection” block with format checking, lead - in “Contacts” and a letter to you;
  • registration for a service or trial lesson: service by button, time by text, confirmation by the administrator;
  • duty response at night: “We received it, we will answer in the morning” - through “Condition” according to the time of day;
  • transfer to the operator: the “Operator” block transfers the conversation to the person in the “Conversations” section, the bot becomes silent.

What the bot does not do to avoid false expectations. He does not respond to comments under posts and does not write on the wall - only personal messages from the community. Doesn't work from a personal page - what you need is a community. Doesn’t send photos and files: in VK, as well as in Telegram and MAX, CHBT sends text and buttons, gives documents as a link. And he doesn’t write first to those who haven’t written to the community - this is a platform rule that is common to all bots.

If you haven’t decided yet whether you need a bot at all and what task to start with, a general analysis is in the article how to create a chatbot without a programmer. Here - only VKontakte.

Before we begin: What should be included in a community

Three settings without which nothing else will work. All of them are in your community’s “Manage” section, and you need administrator rights (an editor is not enough: only an administrator can connect the community to a bot).

  1. “Messages” are enabled. “Manage” → “Messages” → “Community messages: Enabled”. If they are off, people have no “Message” button, and not a single message will reach CHBT.
  2. “Bot features” are enabled. In the same place, under “Bot settings”: turn on bot features and tick “Add “Start” button”. This button gives the bot its entry point: when it is pressed, VK sends a service event and CHBT starts the flow as if it were the /start command.
  3. The community welcome message — turn it off or make it match the bot. VK can show its own greeting when a conversation opens; if it says “Write to us, an administrator will reply” and the bot then offers buttons, people get confused. Let the flow have the first word.

One more thing people forget: the community needs a person who will answer whatever the bot hands over to an operator. CHBT’s inbox, the “Conversations” section, will show these requests, but you or your staff will be the ones replying. Team roles are assigned in the “Access” section.

Connecting in CHBT: with the button or with a community key

The easiest way is the button: no keys and no copying strings.

  1. In your CHBT bot, open “Channels” and click “Connect via VK” on the “VK” card.
  2. Sign in with VK ID using the page that is an administrator of the community. CHBT will show the communities where you are an administrator — pick the one you need and click “Connect”.
  3. VK will ask for permission — click “Allow”. Access to messages lets the bot reply, access to management lets CHBT set up event delivery by itself, and access to photos and files is used for posts with images from the “Studio” section.

You will return to “Channels”, where the community appears as a row with the status “Works”. If VK did not show the list of communities, paste a link to the community, such as vk.com/club123.

The second way is a community key. It comes in handy when the person connecting is not an administrator but a colleague who received the key from one. In VK: “Manage” → “API usage” → “Access tokens” → “Create token”. Tick two permissions — “Community messages” and “Community management”; the bot needs no others. The key starts with vk1.a.; in CHBT, paste it in “Channels” via “Connect using community key” and click “Connect by key”. CHBT checks the key right away: if a permission is missing, the channel is not connected and the error names the permission to tick.

Do not forward the key in chats or keep it in shared documents: CHBT stores it encrypted and never shows it again. You can replace it with “Change key” in the channel row — the channel number and the conversation history stay the same.

Callback API: CHBT sets it up by itself

The Callback API is how VK tells CHBT about new messages and button presses. You do not need to enter the address, confirmation string or secret by hand — CHBT does all of it when you connect:

  • it creates a “CHBT” server in “API usage” → “Callback API” with an address like https://app.chbt.io/webhook/vk/57, a confirmation string and a random secret; if a server with that address already exists, it reconfigures it;
  • it enables API version 5.199 and the events it needs: incoming messages, button presses, allowing and blocking messages, plus comments on posts and products — those are used by comment moderation in “Studio”; the bot does not reply to comments;
  • it sets the status to “Works” only once VK has confirmed the server; if VK has not confirmed it, the status is “Error” with the reason.

If someone in the community deletes or changes the “CHBT” server, click “Reinstall webhook” in the channel row — CHBT will set up the server, secret, version and events again using the saved key.

Testing. Turn on the flow and message the community from a personal page — yours or a colleague’s, not from the administrator interface. If that page has never messaged the community before, press “Start” first. The conversation will appear in CHBT’s “Conversations”, and the bot’s reply will arrive within a second. A short guide and a table of errors by symptom are in the VK connection help.

First flow: template, triggers and features of logging into VK

The script in CHBT is not tied to a channel: the same set of blocks works in VKontakte, Telegram and MAX. But VK has its own input, and this must be taken into account in triggers.

Where to start? For the community where they write “how much does it cost”, take a template "Autoresponder FAQ": keywords for prices and schedule, otherwise - operator. For a community where the main thing is leads - “Collection of applications”: name, phone number, thanks. The template opens with the “Use Template” button and immediately ends up in the “Scripts” section, where it can be edited in the “Steps” mode (linear, available on the Free plan) or on the “Canvas” (Basic and higher).

Three triggers that should be in a VK script.

  • "Command /start" — triggered by the “Start” button. VKontakte sends a service event, CHBT turns it into /start. This is the entrance for those who opened the conversation for the first time.
  • "Key word" in the “contains” mode - “price”, “cost”, “address”, “schedule”. People on VKontakte write to the community as a person, in long phrases: “Hello, please tell me how much a haircut costs.” The “accurate” mode is almost useless here.
  • “Any message” - mandatory. The VK audience has no habit of commands, no one will write /start. If a person wrote something that was not included in the keywords, the script should still respond - with a menu button or immediately transfer it to the operator. An empty answer on VK looks like being ignored by the community.

The name pulls itself up. At the first message, CHBT asks VKontakte for the user’s first and last name and writes it to the contact card - variable {{name}} in messages will be filled in without the question “what is your name”. There is usually no need to ask for a name in the “Data Collection” block on VKontakte; phone - you need it, VK doesn't have one.

If you plan to issue material by word - “price”, “checklist”, “promotional code” - the mechanics are the same as in Telegram and MAX: trigger “Keyword” → “Message” with a link to the material → action “Add tag”. A ready-made skeleton for this - a template “Issuing a lead magnet”.

Buttons on VKontakte: 10 pieces, 2 in a row, 40 characters

CHBT lays out the buttons from the “Message” block under the message in VK automatically. These are the platform rules it has to follow:

  • Up to 10 buttons under one message. If the block has more, the extra ones are not shown — split the menu into two steps: “Services” → specific services.
  • 2 per row, which means at most 5 rows. Eight buttons make four neat rows; with seven, the last one sits alone in its row, and that is fine.
  • Labels up to 40 characters. Longer ones get cut off. Use verbs: “Book”, “Get a price”, “Talk to a person”.
  • Two kinds of buttons. A link button opens a URL — a website, a map, a price list on a drive. A branch button continues the flow (in CHBT, that is the “Button clicked” trigger or the next block). CHBT turns on the button-press event in the Callback API by itself, but for messages with buttons to be delivered at all, “Bot features” must be enabled in the community — see above.

There is one behavioural detail worth knowing. When a person presses a branch button, VK shows a loading indicator on it until the server responds. CHBT clears it as soon as the event arrives, so the button does not “hang” — but if the flow is off or the webhook is broken, the user will see an endless spinner on the button. That makes a handy diagnostic symptom: “it spins and nothing happens” almost always means a connection problem, not a flow problem.

And one design rule that does not depend on the platform: the last button in any menu is a way to reach a person. “Operator”, “Ask your own question”, “Call an administrator” — the name does not matter; what matters is that it is there. Where this button leads and how an operator picks up the conversation is covered in the article bot or operator: handing over a conversation.

Features of VK that affect the flow

A VK bot plays by VK’s rules, and some of them differ from what Telegram bot owners are used to.

  • A user can block messages from the community. The bot then cannot reply to them, and in the conversation it looks like silence. There is nothing you can do about it except ask them to allow messages on the community page.
  • The bot does not see administrator replies sent from the VK interface. If your staff reply to a customer directly in VK rather than from CHBT’s “Conversations”, the flow will not know and may continue its branch on top of a live conversation. Agree on a rule: while the bot is on, replies go from the dashboard. That is what the “Operator” block is for — it stops the bot in that conversation.
  • Sending limits. VK limits how many messages a community can send per second. For conversations this is not a problem; for broadcasts to a large list (the “Broadcasts” section, Basic plan and above) CHBT sends through a queue with delays — a thousand messages go out in a minute or two, not instantly.
  • Subscribing to the community and messaging it are different things. A subscriber is not a bot contact until they write to the community’s messages. Your broadcast audience is the people who have written, not the subscriber count in the header.
  • One connection — one community. A CHBT channel is tied to a specific community; a second community is connected separately — with the button or with its own key.

What it shares with other channels: contact cards from VK go to the same “Contacts”, conversations to the same inbox, deals to the same CRM. If you already have a Telegram bot on CHBT, VK is added to it as one more channel, not as a separate project. An overview of the channel and its capabilities is on the VK chatbot page.

If the bot is silent: seven checks

The list is based on support requests — the causes are listed in the order they come up most often.

  1. Community messages are off or “Bot features” are off. Check “Manage” → “Messages”.
  2. The channel in “Channels” has the status “Error”. The reason is shown next to it. For “VK did not confirm the callback” or “Could not set up event delivery”, delete old unused servers in “API usage” → “Callback API” and click “Reinstall webhook” in the channel row.
  3. The “CHBT” server was deleted or changed in VK. No events arrive, yet nothing changed in CHBT — click “Reinstall webhook”.
  4. The key was revoked or deleted. The status is “Error” with the text “bot token rejected (401 Unauthorized)”, and the owner gets an email. Reconnect the community with the button or paste a new key with both permissions via “Change key”.
  5. The flow is off or has no “Any message” trigger. Someone wrote “hi” — no keyword matched and nothing caught it. Add a catch-all.
  6. The Free plan limit has been reached — 30 conversations per month per project. After 30 people in a month, the bot keeps talking as usual with those who have already written this month, but new people get a service message about the limit instead of the flow, and their messages do not appear in “Conversations”. The number of conversations so far is shown by the “N of 30” counter on the plan card on the bot’s “Overview” page and in the “Payment” section. The limit is lifted on Basic (650 ₽ per bot per month).
  7. The user has blocked messages from communities, or you are writing from the administrator interface. Test from another, personal page.

Debugging order: first “Check flow” in the editor — it shows that the logic works without VK; then a message to the community from a personal page. If the first works and the second does not, the problem is in the connection, items 1–4. The full checklist is in “VK bot isn’t responding”.

What to connect next

The first flow is auto-responses and requests. Once it's been running for a week and you've seen in Conversations what people are actually asking about, there are three logical steps.

  • Tags and segments. The “Add tag” action on the threads (“asked-price”, “signed up”, “waiting-for-operator”) - and a month later in “Contacts” you can see what subscribers want. Mailings are launched based on tags - for example, “free window tomorrow at 15:00” to those who were interested in the recording.
  • AI agent for free questions. On the Basic plan, the “AI Agent” block is added to the script: you describe the company, services and prices in plain text in the “AI Agents” section, and the agent answers questions that are not included in the keywords, and if you are unsure, calls the operator. The agent's default response to models is one AI credit, more expensive on powerful models; Basic includes 150 credits per month.
  • Second channel. If you have an audience in Telegram or MAX, connect them to the same project: the script, contacts and inbox will become common, and differences in texts - if necessary - will be separated by the “Condition” block across the channel.

On the Free plan, everything described in the article - VKontakte connection, template, buttons, operator in “Conversations” - is available without a card; There is only one limit - 30 conversations per month. This is enough to understand whether the bot is taking the load off the community administrator. Create a bot for the VKontakte community →

More on the blog