Skip to content

Bots

How to Create a Telegram Bot for Your Business (No Fluff Guide)

To create a Telegram bot you register it with @BotFather to get a token, write a program that receives updates from the Bot API (grammY for Node.js or aiogram for Python are the standard choices), handle commands, messages and button presses, deploy it with a webhook on an HTTPS server and configure commands, description and privacy settings in BotFather. A basic business bot takes a developer one to two days; production bots with payments, CRM integration and an admin panel take 2–5 weeks.

Published 2026-10-30 · Updated 2026-10-30 · 8 min read · By the TGminiAppDev team

Key takeaways

  • BotFather issues the token; everything else is your code talking to the Bot API.
  • grammY (TypeScript) and aiogram (Python) are the frameworks most production bots use.
  • Use webhooks in production, long polling only for development.
  • Design conversations like a UI: every state needs a way back and a way out.
  • Add a Mini App when buttons are no longer enough.

Step 1: Register the bot

Message @BotFather, send /newbot, choose a display name and a unique username ending in bot. BotFather replies with a token like 123456:ABC-DEF.... Store it as a secret; anyone with the token controls the bot.

While you are there, set /setdescription (shown before the user presses Start), /setabouttext, /setuserpic and /setcommands so the menu shows what the bot can do.

Step 2: Choose a framework

FrameworkLanguageGood for
grammYTypeScript / Node.jsMost production bots, Mini App companions, serverless deployments
aiogram 3PythonTeams with Python backends, data-heavy bots, AI integrations
python-telegram-botPythonMature, large community
TelegrafNode.jsLegacy projects (grammY is its successor in spirit)

Step 3: Write the first handlers

import { Bot, InlineKeyboard } from 'grammy';

const bot = new Bot(process.env.BOT_TOKEN!);

bot.command('start', (ctx) =>
  ctx.reply('Hi! What would you like to do?', {
    reply_markup: new InlineKeyboard()
      .text('Book a call', 'book')
      .text('Pricing', 'pricing'),
  })
);

bot.callbackQuery('pricing', async (ctx) => {
  await ctx.answerCallbackQuery();
  await ctx.reply('Plans start at $490/month. Want details?');
});

bot.start(); // long polling for development

Model the conversation as states: each message should offer the next step and a way back. Store state per user in a database, not in memory, so restarts and multiple instances do not lose context.

Step 4: Add the features businesses need

  • Lead capture: ask for name, email or phone with validation; write to your CRM (CRM integration).
  • Notifications: order status, reminders, alerts, sent only to users who started the bot and with rate limits (roughly 30 messages per second across all users).
  • Payments: Stars invoices for digital goods; card providers for physical goods (payments).
  • Group features: moderation, welcome messages, commands restricted to admins; mind privacy mode, which hides group messages from the bot unless it is an admin or mentioned.
  • Inline mode: let users call the bot from any chat with @yourbot query.
  • AI answers: connect an LLM with retrieval over your documents (AI chatbots).

Step 5: Deploy with a webhook

In production, register an HTTPS endpoint with setWebhook so Telegram pushes updates to your server. Use a secret token to verify requests, respond within seconds and process heavy work in a queue. Host on any cloud; serverless functions work well for low-volume bots. Keep logs without personal data and set up uptime monitoring.

Step 6: Operate it

Build or use an admin panel to see users, broadcast messages, export leads and watch errors. Review BotFather settings (privacy mode, inline, menu button) and write a short runbook: what to do when the token leaks, when Telegram restricts the bot, when the webhook fails.

When to add a Mini App

Buttons and text carry you far, but catalogs, multi-step forms, dashboards and games need a screen. A Mini App attaches to the same bot and opens from the menu button or any inline button, so nothing in the bot is wasted. See what a Mini App is and how to create one.

If you would rather have it built: Telegram bot development starts at $2,500.

* All prices and ranges on this page are indicative. The final cost is calculated for each project individually and depends on the complexity of the task, the number of developers and specialists required, and the delivery timeline you set. Use the ranges to understand the typical bracket, not as a fixed offer; the fixed price is confirmed in writing after scoping. Read our pricing terms.

Frequently asked questions

Is creating a Telegram bot free?
Yes. Telegram charges nothing for bots or the Bot API. You pay only for hosting and for your developer's time.
Which language should I use?
TypeScript with grammY or Python with aiogram. Both have mature libraries, good documentation and large communities. Choose the language your team already knows.
Can a bot accept payments?
Yes. Telegram Stars for digital goods, and card providers through the invoice API for physical goods and services.
Bot or Mini App?
Start with a bot for conversational tasks. Add a Mini App when users need catalogs, forms, dashboards or games. See the comparison.

Ready to build your Telegram Mini App?

Tell us what you want to build. You get a scoped estimate with timeline and milestones, usually within one business day.

Message us on Telegram

No commitment. Replies within one business day, Monday to Friday.