Spark
Vibe coding: from idea to production

Bots and AI assistants as a product

Topic 296 min read + 30 min for the taskRevised October 10, 2026

Everything in the “Vibe coding: websites” and “Vibe coding: interfaces” topics builds websites and apps: products the user comes to at an address. A chatbot in Telegram, WhatsApp or Slack is a different kind of product. It lives where the audience already hangs out, needs no install and opens in the same interface people already use to text their friends. For a designer, it’s a separate and very real way to deliver work to a client: not just a landing page or a prototype, but a working bot that solves a specific business problem. The agent will write the code for you. Your part is the scenario, and that’s where we’ll start.

The business scenario comes before the code

The first question before you open a vibe coding agent isn’t “which stack should I use” but “what specific problem does this bot solve”. Common business scenarios: a support bot that answers typical customer questions before a live person steps in; a lead-qualifying bot that asks a few clarifying questions and hands a ready request to a manager; an internal team helper that looks up answers in the company knowledge base; an educational bot that delivers material in small portions (a handy format for courses and onboarding). Without a clear scenario, a bot easily turns into a pile of random features with no single goal. The same principle as in the “Briefs with AI” topic applies: describe the task and the user first, not the technical details.

AI as a copilot, not the bot’s only brain

The temptation is understandable: put all of the bot’s logic into one big AI prompt that tries to understand any message. In practice, a hybrid setup is more reliable. There’s a predictable skeleton of buttons and fixed scenarios (menus, sections, ready answers) that always works the same way. AI comes in at specific points, where you really need flexibility: a free-form question that doesn’t fit the menu, tailoring an answer to the context of the conversation, pulling the gist out of a long message. It’s the same “gradually increasing autonomy” principle from the “UX patterns for AI features” topic, applied to the architecture of the bot itself. Don’t hand everything to the model at once. Draw a clear line between where the bot follows rules and where it thinks.

Python environment and dependencies: what to know without being a developer

Most bots for Telegram and similar platforms are written in Python. It’s not the only option, but it has the largest base of ready-made libraries and documentation specifically for bots. A vibe coding agent (the “CLI and terminal AI agents” topic) will install the dependencies and set up a virtual environment on its own. A venv is an isolated space where one project’s dependencies don’t get mixed up with other projects on the same computer. All you need to know is this: if the agent writes “activating the virtual environment” or “installing dependencies from requirements.txt”, that’s a normal, expected part of the process. Nothing is going wrong.

Building the bot: the shortest path from idea to first reply

  1. Register the bot with @BotFather in Telegram (or a similar service on another platform). This gives you an access token: a unique key the platform uses to recognize this particular bot.
  2. Ask the agent to build a minimal skeleton: a /start command handler, a main menu with buttons, a reaction to a text message.
  3. Plug in the AI layer where the scenario from the first step really needs it. Not before the skeleton responds to commands predictably.
  4. Test locally, on your own computer, before you think about running it on a server full time.
Build a minimal Telegram bot in Python: the /start command shows a greeting and three menu buttons; when the 'Ask a question' button is pressed, the bot forwards the user's next message to the Claude API with the system prompt 'answer only about [X]; if the question is off-topic, politely decline' and sends back the answer

Running on a server: the bot has to work even when your computer is off

A website from the “Vibe coding: websites” topic usually runs on request: someone opened the link. A bot works differently. It constantly listens for new messages, which means it has to run around the clock, not just while your laptop is open. Practical options, from simple to more flexible:

  • Managed PaaS hosting (Railway, Render, Fly.io and the like) — the lowest barrier to entry. You connect the repository with the code, and the service runs the bot and restarts it if it crashes. It’s cheap at low load, but almost never free. After Railway’s 30-day trial with $5, you’re left with a free plan with $1 of credit a month, which isn’t enough for an always-on bot. A free Render instance spins down after 15 minutes without traffic, and a bot needs to run constantly.
  • Your own VPS (virtual server) — more control and usually cheaper under constant load. But you have to set up a persistent process yourself, so the bot restarts on its own after a crash instead of staying down until the next manual restart. Ask the agent to set this up with system tools like systemd or the pm2 process manager. You won’t have to learn them from scratch.
  • A serverless function with a webhook — instead of an always-running program, the platform “wakes up” the code every time a new message arrives. It’s cheaper for bots that get messages rarely, but less predictable in response time.

Before you give the bot its token and any API keys on the server, go through the checklist in the “Securing a vibe-coded project” topic. The bot token gives full control over the bot, and leaking it is as bad as leaking a password.

An AI assistant inside a bot: a practical pattern

Once the AI layer is connected, don’t let it answer absolutely everything. Set clear boundaries. First, a clear system prompt about the topic the bot never strays from (see the “Foundations” topic). Second, an explicit fallback answer if a question is off-topic or the model isn’t sure (the graceful failure principle from the “Design principles for AI products” topic). Third, a clear escalation to a live person for scenarios where a mistake is costly. A bot that honestly says “I’m not sure, let me bring in a colleague” looks more reliable to the user than a bot that confidently makes up an answer.

Command examples for practice

Where to pasteAny chat assistant: ChatGPT, Claude, Gemini
Describe a business scenario for a Telegram bot for a design studio: what one specific problem it solves for the studio’s clients, and which 3–4 items should be in its menu
Where to pasteTerminal agent, in the empty folder for the future bot
Build a minimal Telegram bot skeleton in Python with aiogram 3: a /start command and one menu item that forwards the user’s question to an AI with a restricted system prompt. Take the bot token and the model key from .env, use long polling. At the end, write the commands to run it locally
Where to pasteAny chat assistant: ChatGPT, Claude, Gemini
Compare Railway, Render and my own VPS for a bot with low load (up to 100 messages a day) — which is easier to launch and cheaper to keep running for the first six months. First check current pricing on the official pages and give me links. Keep in mind that the bot is a constant background process, not a web service: free instances that spin down without traffic won’t work for it

You need a chat with search turned on: hosting prices from memory go stale faster than anything else.

Come up with a clear fallback answer for a support bot when the user asks something outside the bot’s topic
Mini-task

Describe in words (without a single line of code) the business scenario of one bot for your own real task or an imaginary client’s. Who uses it, what one problem it solves, what should be in the fixed menu, where AI flexibility is really needed, and what the bot says when a question is off-topic or it isn’t sure. It’s the same first step every real bot needs, before you open the agent.

Time: 30 minutes
Done when: one page describes who the user is, the one problem the bot solves, what’s in the menu, where AI is needed and what the bot says when it doesn’t know

Sources

  1. From BotFather to Hello Worldcore.telegram.org

    getting a token from BotFather and keeping it safe

  2. Free Trialdocs.railway.com

    Railway’s 30-day trial with $5, then $1 a month

  3. Deploy for Freerender.com

    Render’s free services spin down after 15 minutes without traffic

  4. aiogram documentationdocs.aiogram.dev

    aiogram 3, long polling and webhooks

Found a mistake or an outdated fact? Write to hey@iskra.guide