Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Expert in building Telegram bots that solve real problems - from simple automation to complex AI-powered bots. Covers bot architecture, the Telegram Bot API, user experience, monetization strategies, and scaling bots to thousands of users. Use when: telegram bot, bot api, telegram automation, chat bot telegram, tg bot.
.claude/skills/davila7-telegram-bot-builder-8f46ee/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-23 | ✗→✓ | ▲ Improved | 80% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 62% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 112% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 77% | 0% |
Role: Telegram Bot Architect
You build bots that people actually use daily. You understand that bots should feel like helpful assistants, not clunky interfaces. You know the Telegram ecosystem deeply - what's possible, what's popular, and what makes money. You design conversations that feel natural.
Structure for maintainable Telegram bots
When to use: When starting a new bot project
python## Bot Architecture ### Stack Options | Language | Library | Best For | |----------|---------|----------| | Node.js | telegraf | Most projects | | Node.js | grammY | TypeScript, modern | | Python | python-telegram-bot | Quick prototypes | | Python | aiogram | Async, scalable | ### Basic Telegraf Setup
import { Telegraf } from 'telegraf';
const bot = new Telegraf(process.env.BOT_TOKEN);
// Command handlers bot.start((ctx) => ctx.reply('Welcome!')); bot.help((ctx) => ctx.reply('How can I help?'));
// Text handler bot.on('text', (ctx) => { ctx.reply(You said: ${ctx.message.text}); });
// Launch bot.launch();
// Graceful shutdown process.once('SIGINT', () => bot.stop('SIGINT')); process.once('SIGTERM', () => bot.stop('SIGTERM'));
### Project Structuretelegram-bot/ ├── src/ │ ├── bot.js # Bot initialization │ ├── commands/ # Command handlers │ │ ├── start.js │ │ ├── help.js │ │ └── settings.js │ ├── handlers/ # Message handlers │ ├── keyboards/ # Inline keyboards │ ├── middleware/ # Auth, logging │ └── services/ # Business logic ├── .env └── package.json
Interactive button interfaces
When to use: When building interactive bot flows
python## Inline Keyboards ### Basic Keyboard
import { Markup } from 'telegraf';
bot.command('menu', (ctx) => { ctx.reply('Choose an option:', Markup.inlineKeyboard( Markup.button.callback('Option 1', 'opt_1')], Markup.button.callback('Option 2', 'opt_2')], Markup.button.callback('Yes', 'yes'), Markup.button.callback('No', 'no'), ], ])); });
// Handle button clicks bot.action('opt_1', (ctx) => { ctx.answerCbQuery('You chose Option 1'); ctx.editMessageText('You selected Option 1'); });
### Keyboard Patterns
| Pattern | Use Case |
|---------|----------|
| Single column | Simple menus |
| Multi column | Yes/No, pagination |
| Grid | Category selection |
| URL buttons | Links, payments |
### Paginationfunction getPaginatedKeyboard(items, page, perPage = 5) { const start = page perPage; const pageItems = items.slice(start, start + perPage);
const buttons = pageItems.map(item => Markup.button.callback(item.name, item_${item.id})] );
const nav = ]; if (page > 0) nav.push(Markup.button.callback('◀️', page_${page-1})); if (start + perPage < items.length) nav.push(Markup.button.callback('▶️', page_${page+1}));
return Markup.inlineKeyboard(...buttons, nav]); }
Making money from Telegram bots
When to use: When planning bot revenue
javascript## Bot Monetization ### Revenue Models | Model | Example | Complexity | |-------|---------|------------| | Freemium | Free basic, paid premium | Medium | | Subscription | Monthly access | Medium | | Per-use | Pay per action | Low | | Ads | Sponsored messages | Low | | Affiliate | Product recommendations | Low | ### Telegram Payments
// Create invoice bot.command('buy', (ctx) => { ctx.replyWithInvoice({ title: 'Premium Access', description: 'Unlock all features', payload: 'premium_monthly', provider_token: process.env.PAYMENT_TOKEN, currency: 'USD', prices: { label: 'Premium', amount: 999 }], // $9.99 }); });
// Handle successful payment bot.on('successful_payment', (ctx) => { const payment = ctx.message.successful_payment; // Activate premium for user await activatePremium(ctx.from.id); ctx.reply('🎉 Premium activated!'); });
### Freemium StrategyFree tier:
Premium ($5/month):
### Usage Limitsasync function checkUsage(userId) { const usage = await getUsage(userId); const isPremium = await checkPremium(userId);
if (!isPremium && usage >= 10) { return { allowed: false, message: 'Daily limit reached. Upgrade?' }; } return { allowed: true }; }
Why bad: Telegram has timeout limits. Users think bot is dead. Poor experience. Requests pile up.
Instead: Acknowledge immediately. Process in background. Send update when done. Use typing indicator.
Why bad: Users get no response. Bot appears broken. Debugging nightmare. Lost trust.
Instead: Global error handler. Graceful error messages. Log errors for debugging. Rate limiting.
Why bad: Users block the bot. Telegram may ban. Annoying experience. Low retention.
Instead: Respect user attention. Consolidate messages. Allow notification control. Quality over quantity.
Works well with: telegram-mini-app, backend, ai-wrapper-product, workflow-automation
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 16,555 | 11,787 | -29% | 1 | 1 | 0% | 3,885 | 4,093 | +5% | 0 | 0 | — |
case-02 | fail→fail | 16,478 | 13,483 | -18% | 1 | 1 | 0% | 3,285 | 4,236 | +29% | 0 | 0 | — |
case-03 | pass→pass | 10,662 | 10,827 | +2% | 1 | 1 | 0% | 2,124 | 3,767 | +77% | 0 | 0 | — |
case-23 | fail→pass | 8,245 | 7,341 | -11% | 1 | 1 | 0% | 1,706 | 3,070 | +80% | 0 | 0 | — |
case-04 | pass→pass | 13,088 | 13,271 | +1% | 1 | 1 | 0% | 2,329 | 3,972 | +71% | 0 | 0 | — |
case-05 | pass→pass | 11,248 | 11,860 | +5% | 1 | 1 | 0% | 2,281 | 3,617 | +59% | 0 | 0 | — |
case-06 | fail→fail | 5,942 | 8,220 | +38% | 1 | 1 | 0% | 1,169 | 3,073 | +163% | 0 | 0 | — |
case-07 | pass→pass | 13,101 | 11,051 | -16% | 1 | 1 | 0% | 2,412 | 3,526 | +46% | 0 | 0 | — |
case-08 | fail→pass | 9,498 | 8,383 | -12% | 1 | 1 | 0% | 1,773 | 2,873 | +62% | 0 | 0 | — |
case-09 | pass→pass | 15,656 | 16,099 | +3% | 1 | 1 | 0% | 2,931 | 4,430 | +51% | 0 | 0 | — |
case-10 | pass→pass | 11,602 | 10,197 | -12% | 1 | 1 | 0% | 2,474 | 3,745 | +51% | 0 | 0 | — |
case-11 | pass→pass | 7,049 | 5,007 | -29% | 1 | 1 | 0% | 1,444 | 2,455 | +70% | 0 | 0 | — |
case-12 | pass→pass | 7,298 | 5,844 | -20% | 1 | 1 | 0% | 1,418 | 2,705 | +91% | 0 | 0 | — |
case-13 | pass→pass | 16,081 | 12,763 | -21% | 1 | 1 | 0% | 2,943 | 4,164 | +41% | 0 | 0 | — |
case-14 | pass→pass | 13,773 | 11,691 | -15% | 1 | 1 | 0% | 2,654 | 3,889 | +47% | 0 | 0 | — |
case-15 | fail→pass | 11,744 | 15,559 | +32% | 1 | 1 | 0% | 2,142 | 4,544 | +112% | 0 | 0 | — |
case-16 | pass→pass | 3,137 | 2,539 | -19% | 1 | 1 | 0% | 648 | 2,099 | +224% | 0 | 0 | — |
case-17 | fail→pass | 11,664 | 7,372 | -37% | 1 | 1 | 0% | 2,809 | 3,023 | +8% | 0 | 0 | — |
case-18 | pass→pass | 5,983 | 4,133 | -31% | 1 | 1 | 0% | 1,101 | 2,323 | +111% | 0 | 0 | — |
case-19 | pass→pass | 6,644 | 5,293 | -20% | 1 | 1 | 0% | 1,353 | 2,611 | +93% | 0 | 0 | — |
case-20 | pass→pass | 7,394 | 5,405 | -27% | 1 | 1 | 0% | 1,572 | 2,568 | +63% | 0 | 0 | — |
case-21 | pass→pass | 11,735 | 15,044 | +28% | 1 | 1 | 0% | 2,259 | 3,984 | +76% | 0 | 0 | — |
case-22 | pass→pass | 3,221 | 2,726 | -15% | 1 | 1 | 0% | 551 | 1,992 | +262% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +17 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.