← All projects
A bot connects orders, money, documents, spreadsheets, and routes

Vibe Coding: How I Built a Telegram Order Bot

October 31, 2026 · Vasilii Anisimov

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

Specraz bot: order draft
Specraz bot: order draft

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.

Specraz bot: order created
Specraz bot: order created

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

One order's path through the bot
One order's path through the bot

How I built it

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

Commits in the bot folder by month
Commits in the bot folder by month

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?

Done
Done

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.

Message me on Telegram