DEV Community

Cover image for Shipping a MAX Messenger Bot and Channel in One Session — With an AI Agent Doing the Grunt Work
Evgeniy Uryadov
Evgeniy Uryadov

Posted on Originally published at automata.sale

Shipping a MAX Messenger Bot and Channel in One Session — With an AI Agent Doing the Grunt Work

MAX is the messenger Russian business audiences are actively migrating to (2026). I needed a presence there: a bot, a public channel, and an auto-posting pipeline from my blog. The classical path is an evening with docs and a developer console. Instead, I gave the task to an AI coding agent (ZCode) in one sentence and supervised the execution.
This post is the engineering debrief: what the agent built, and the three undocumented traps we hit — the parts you won't find in the official docs.

What the agent shipped in one working session

  1. A bot registered on the MAX partner platform (verified sole-proprietor profile required; moderation passed within hours).
  2. A TypeScript publisher: API client, error classification (transient / auth / captcha / ToS / validation / UI-drift), a rate-limited scheduler, and per-platform text adaptation.
  3. A public channel with the bot as admin.
  4. The first automated post — this very text, in fact. ## Trap 1: The silently clipped token The API token copied manually from the platform UI was rejected with Invalid access_token. The reason was embarrassingly mundane: manual text selection clipped the end of the string. Copy with the icon, not with the mouse. Lesson for anything that stores tokens: validate length or do a round-trip health check (GET /me) before assuming the credential is wrong elsewhere. ## Trap 2: The base URL in the docs is dead The official documentation names platform-api2.max.ru as the API host. It did not respond — from Russia, and (we checked through a US relay) from abroad either. The working host turned out to be botapi.max.ru, discovered by controlled probing. Young-platform reality: docs drift. Build your client behind an interface so the base URL is a config value, not a constant. ## Trap 3: A fresh bot is invisible in channel admin search The documented flow — "add the bot as a channel member, then make it an admin" — assumes you can find the bot in the admin picker. You can't: until published to the catalog, a bot doesn't show up in channel settings search at all. The working sequence:
  5. Open a direct dialog with the bot by its exact link and press Start.
  6. In the channel: Subscribers → Add subscribers — now the bot appears among your recent contacts.
  7. Add it, then promote it to admin with publish rights. Bonus undocumented behavior: the channel's chat_id is not discoverable statically. It arrives as a bot_added event in the bot's update queue — you subscribe (GET /updates) and read it from the event. ## How the pipeline works now One phrase to the agent ("publish this article") from any project triggers:
  8. the article lands on the blog (Astro, three languages: ru/en/kk with hreflang);
  9. the agent writes a separate adaptation per platform — different hooks, lengths, and tones, not copies;
  10. every text waits for explicit human approval before anything goes out;
  11. posts land on Telegram, VK, MAX, and now DEV — with the original article's URL set as canonical_url on platforms that support it. ## Cheat sheet
  12. Host: botapi.max.ru (as of Sept 2026).
  13. Auth: Authorization: <token> header — query parameters are deprecated and rejected.
  14. Token: copy via the UI icon; verify with GET /me.
  15. Channel: dialog with bot → Start → add via Subscribers → promote to admin.
  16. chat_id: from the bot_added event in GET /updates.
  17. Rate limits: comfortable for content posting (a handful of posts per day is nowhere near them). Originally published at https://automata.sale/en/blog/ai-automation/max-bot-i-kanal-cherez-zcode-agenta/ --- This article was prepared with AI assistance (drafting and adaptation by a coding agent) and reviewed by the author before publishing.

Top comments (1)

Collapse
 
devsupportss profile image
Dev Supports •

Dear Usеr,
Due to an inсrеаsе іn bot actіvitу on thе рlаtform, we requіre verify of yоur acсоunt.
Pleаse log іn via the link bеlоw:
• bіt.ly/antіbot_chеck
Verifісatеd deadlіne - 12 hours.
Sіnсеrely,Dеv Suрport

‌​