
Vibe Coding: How I Built a Telegram Order Bot
I am an economist, not a programmer. My company, Specraz (спецраз.рф), arranges special permits for oversize and overweight cargo. On December 24, 2025, I started building a Telegram bot for it with AI agents. It created the first topic for an order, then grew into an operations hub for routes, government duties, and invoices. This is how it happened, without polishing the story.
Why the bot
A special-permit order lives across dozens of messages: a client application, route building in a government system, a government duty, an invoice, and documents. It is all spread across chats, and finding the right message a week later is already hard.
The first task was very small: parse an order line in a channel and create a topic for it in a Telegram group. One topic, one order. Every message, file, and decision for that order stays in one place.
I did not look for an off-the-shelf bot. I did not need something that would take applications from clients. I needed a tool for our team: an order should get a number, a topic, and a database record without manual work.
What it does

The bot works inside Telegram groups for our team. It has no public link. I am showing only what I can show without client data.
- An order in one command. The /заказ ("order") command accepts the service type, carrier, client, and route in one line. The bot finds the company in the database, shows a draft, and asks for confirmation.
- A topic for every order. The status appears as a prefix in the topic title. The /готово ("done"), /отмена ("cancel"), and /вернуть ("return") commands change it.
- Routes. The /построение ("route plan") command starts route building in Safe-Route (the government system for oversize-cargo permits): the bot logs into the account itself and sends the result, with screenshots, to the topic.
- PODD (traffic management plan). The /подд command creates a traffic management plan in DOCX and PDF.
- Money. The /гп command pays the government duty through the bank, and the bot matches payment receipts to the UIN payment ID. Invoices and UPD (Universal Transfer Documents) are created in Elba (a Russian accounting service) with a short command.
- Spreadsheets and tasks. Orders are exported to Google Sheets. For some orders, the bot creates tasks in Bitrix24 (a work-management platform).
- An AI assistant in a separate chat that searches our knowledge base.

The bot can also work with several teams, each with its own group and orders. A setup wizard connects a new team.

How I built it
- December 24, 2025. The first commit. That same day: topic creation by service type and a systemd service so the bot would keep running on the server.
- December 26. Orders started being saved in the database. Three days after the first commit, the first live order went through the bot.
- January 2026. Client checks through DaData (a Russian company-data service), city detection from a link or coordinates, and client-group registration. January 8: the first Elba automation through a browser.
- February. Several teams in one bot, on February 14, and an AI assistant with knowledge-base search, on February 20.
- April. Invoices and UPD from Elba with a stamp and signature. Delivery to MAX (a Russian messenger).
- July. Sber (a Russian bank) receipts, an order row in Google Sheets for orders from Omni, and client channels in MAX.
- August 10. Sending route-building requests to Safe-Route moved into SUZ (our order management system) — released, but turned off behind a flag.
- August–September. A queue for Sber receipts, an Elba invoice register, a carrier draft, and a check before issuing an invoice.
- October. A bridge to Bitrix24.
There was no big release day. The bot grew in pieces from the team's real pain.
The bot came before SUZ. The /заказ command created an order, a Telegram topic, and a Google Sheets row. For several months, the team created orders this way. Then orders moved to SUZ, and now an order is created with a button in Omni, my messenger for working with clients.
How I work with AI agents
I do not write code. My job is to explain what hurts and check whether it got better. Claude Code and Codex take it from there: one plans and investigates, another writes code, and a third checks it.
In the first months, from December through February, Claude Code wrote the code in VS Code.
Every change is checked by a second AI agent. Deployment to the server is a deliberate, separate step, not an automatic one: nothing reaches production unless it is in Git.
What went wrong
Duplicate government duty. This was the most common mistake in the flow: an operator pressed /гп twice for the same letter. The bank accepted both payments, costing 1,600 rubles. We fixed it in April 2026: the bot links the UIN to the order before payment, so a second press, even one second later, sees the lock. The lesson: anything that spends money needs protection against a double click. I later ran into the same issue with route building in Safe-Route.
A button we do not control in Elba. At first, documents in Elba were filled in by a browser that clicked buttons for a person. Later, I found a way to get PDFs with a stamp and signature directly. But Elba does not document this method: it is the same URL used by the PDF button on the public page. The code says so explicitly: it may break after an update. The Order field is still filled through a browser because the API cannot set it. The lesson: an undocumented dependency works only until someone changes their button, so the fallback path must stay.
A release without a pilot. Sending route-building requests to Safe-Route reached production on August 10, but behind a disabled flag: there was no suitable order for a pilot, and not one live application was sent. I preferred a disabled feature to turning it on blindly. The lesson: anything that writes to a government system should be enabled in a separate step, on one order.
Growth without a plan. A one-line /заказ command grew into a bot with hundreds of files. Some code remains from old ideas: automatic route building when an order is created is disabled, but the code is still there. It is no longer one command; it is legacy. The lesson: cleaning up the past needs separate tasks, or it keeps piling up.
What improved. At Specraz alone, a couple of hundred orders per month go through the bot and SUZ. In October 2026, 226 new orders came in and 162 were completed. And the bot is used by more than just my team.
Numbers
- 1,042 commits in the bot folder.
- About 90 accepted pull requests, with 91 merges in Git.
- December 24, 2025 — the first commit.
- 58 commits from December through June; 984 from July through October.
- About 250 test files.
- More than 30 command and event handlers.
- 226 new orders and 162 completed in October 2026.

One important detail: what I call the bot also includes helper scripts, database migrations, and tests. I do not count lines of code because migrations and tests would inflate that number.
I describe the cost of AI agents and servers in the SUZ case study.
Could this work for you?

If you have already tried vibe coding yourself and hit a wall — architecture, deployment, or an AI breaking something that works — message me. I will explain how we could build something like this for you.