Background
Leila had been building Telegram bots as side projects for two years before committing to PulseBot as a full product. She understood the Telegram API well, but connecting it cleanly to billing data, session management, and AI responses was always messy. She'd built custom webhook handlers and inline keyboard flows multiple times. When she decided to build PulseBot on a proper foundation, she needed Telegram support that wasn't an afterthought — ideally with billing commands and AI chat already wired.
The challenge
Leila needed a Telegram integration that included: webhook-based message handling (not polling), slash command routing for /upgrade, /plan, and /usage, access to the user's current subscription and usage data from within the bot, AI chat responses via the same underlying AI infrastructure as the web app, and attachment support for file-based queries. A custom implementation would work, but maintaining it alongside an evolving product was expensive.
How they built it
Webhook bot running in an hour
ShipAI's Telegram integration uses webhook-based message handling with a slash command router. After configuring the bot token and webhook URL, Leila had a running bot that could receive and respond to messages in under an hour. The webhook validation, message type handling, and command routing were pre-implemented.
/usage command connected to real billing data
Leila's key feature was a /usage command that returned the user's current usage count and plan limits in a Telegram message. The command handler connected to the same usage metering data as the web dashboard. Users checking usage via Telegram saw the same numbers as the web UI — no separate data source to maintain.
Billing upgrade flow from Telegram
The /upgrade command triggered the Stripe checkout flow — ShipAI's Telegram integration includes a pre-wired upgrade path that generates a session-linked checkout URL and sends it to the user. Leila's users could upgrade from free to paid without opening a browser tab for anything except the Stripe checkout itself.
AI chat in Telegram with attachment support
PulseBot's core feature is AI analysis of user-provided data. Leila used the Telegram integration's attachment support to let users send files or images directly in the chat. The attachment processing was handled by the pre-built file handling in the bot integration, connected to the same AI infrastructure as the web app.
Outcomes
28% retention improvement
Users who used the /usage command at least once per week had 28% higher 30-day retention than users who only used the web dashboard.
Telegram bot built in one afternoon
Webhook handling, slash commands, billing data access, and AI chat — all operational in an afternoon using the pre-built integration.
15% of upgrades via Telegram command
Within 30 days of launching the /upgrade command, 15% of paid conversions were happening directly from Telegram without a browser session.
No separate data layer for bot
The Telegram bot uses the same usage metering, session data, and billing information as the web application — zero data duplication or sync issues.
In their own words
The thing about Telegram is that it's where some of my users actually live. They open Telegram dozens of times a day and my app maybe once a week. Moving the /usage check into Telegram meant I became part of their daily environment, not something they had to remember to visit. That's why the retention moved.
“The Telegram bot integration surprised me. I added a /usage command so our users can check their plan limits directly in Telegram. Took me an afternoon. Our retention improved because power users never have to open the dashboard for status checks. That's a genuinely differentiating UX feature.”
— Leila Mansouri
Frequently asked questions
How does the Telegram /upgrade command work technically?
The /upgrade command handler calls the same Stripe checkout session creation endpoint as the web app, using the user's session data to associate the checkout with their account. It returns a Stripe Checkout URL in the Telegram message. When the user completes the payment, the webhook updates their subscription exactly as it would from a web checkout.
Is the Telegram bot state separate from the web app state?
No — the Telegram bot uses the same database, session management, and usage metering as the web application. There is no separate bot state. Actions in the bot (like using a prompt) count against the same usage limits as web actions.
What attachment types are supported?
The pre-built integration handles images, documents, and voice messages from Telegram. File processing passes attachments to the AI handler, which processes them using the configured AI provider's multimodal capabilities.