Building a Telegram or Bale Bot for Your Business: From Idea to Payments
A practical guide to commissioning a Telegram or Bale bot: platform differences, webhooks, in-bot payments, security, and what determines the cost.
- Telegram bot
- Bale bot
- build a Telegram bot
- business bots

For many businesses, a messaging bot is a cheaper path than building an app. Users install nothing, already know the interface, and can order, get support, or submit information right there. I built the Telegram bot for Kolang, and this guide covers what to know before you start.
What a bot is good for
- Sales and orders: showing products, taking orders, and tracking status
- Support: answering repeated questions and passing the rest to a person
- Internal team work: field reports, approvals, and event alerts
- Memberships and payments: selling subscriptions and delivering content automatically
- AI assistants: answers based on your own business data
If you need complex screens, charts, or large tables, add a web app alongside the bot.
Telegram or Bale?
According to the official Bale docs, its API is based on Telegram’s Bot API with minor changes, so much of the logic can be shared.
| Topic | Telegram | Bale |
|---|---|---|
| Creating a bot | BotFather | @botfather on Bale |
| API address | api.telegram.org |
tapi.bale.ai |
| Webhook ports | 443, 80, 88, 8443 | 443 and 88 |
| Receiving money | Telegram Stars and providers | Bale wallet |
The Bale docs also say card to card was removed and the wallet is the only current way to receive money. Details change, so check current docs before you start.
If local users and rial payments matter, take Bale seriously. For an international audience, Telegram fits better. For both, keep the core logic separate and build one adapter per platform.
Webhook or getUpdates?
- getUpdates: the bot keeps asking the server for new messages. Simple, and good for small projects.
- Webhook: the platform sends each message to your server. Better for production, but it requires HTTPS.
Telegram’s webhook guide requires TLS 1.2 or higher and says there is nothing wrong with getUpdates if it works for you. Bale’s docs say it keeps the last 2,000 messages for 24 hours, so a bot should not stay offline for long.
Payments inside a bot
Payments are the most sensitive part. On Bale, the flow is:
- The bot sends an invoice with
sendInvoice. - A
PreCheckoutQueryarrives, and you must answer within 10 seconds or the payment is cancelled. - Only the
SuccessfulPaymentmessage confirms payment, not the previous step.
Rules for any payment system:
- Record the order before payment, so you can follow up if no response comes.
- Apply each payment exactly once. A duplicate message must not grant credit twice.
- Start with a test token. Bale provides one that moves no money.
- Query the payment status, and never trust a user’s message or receipt photo.
Bot security
- Keep the token out of your code. Whoever has it controls the bot. Replace it immediately if it leaks.
- Validate user input. Users can tamper with any button or callback.
- Check admin rights on the server, not by hiding buttons.
- Add rate limits, so one user cannot take the system down.
- Protect the webhook URL against forged messages.
- Keep only the personal data you need.
What determines the cost
A single figure is not useful, because a simple responder and a sales bot connected to stock and payments are very different. These factors set the price:
- Number of scenarios and conversation paths
- Admin panel
- Payments and settlement
- Integrations with a website, CRM, or accounting
- Support for several platforms
- AI features and model usage costs
- Hosting, backups, and maintenance
No-code builders suit simple work and testing ideas. For payments, custom logic, or full data ownership, a custom build usually makes more sense.
Before you order
- What exactly will the bot replace?
- What are the three main scenarios for version one?
- Whose name are the token, code, and data in?
- How does support work after delivery?
The project brief guide can help you organize this. If you need a Telegram or Bale bot, send me the details.