[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-8d29b2c5-7c1f-455e-8ea2-10dd41e1baaf":3,"$fOlC8EutnsEtl2VVklUuot5yJTyPIaMPrL7OYxpax9CI":43},{"id":4,"title":5,"description":6,"categoryId":7,"moduleId":8,"tags":9,"prompt":10,"icon":11,"source":12,"sourceUrl":13,"authorId":14,"authorName":15,"isPublic":16,"stars":17,"runs":18,"createdAt":19,"updatedAt":19,"module":20,"category":27,"packages":34},"8d29b2c5-7c1f-455e-8ea2-10dd41e1baaf","telegram-bot-builder","Telegram机器人构建专家，解决实际问题——从","cat_life_career","mod_other","sickn33,other","---\nname: telegram-bot-builder\ndescription: Expert in building Telegram bots that solve real problems - from\n  simple automation to complex AI-powered bots. Covers bot architecture, the\n  Telegram Bot API, user experience, monetization strategies, and scaling bots\n  to thousands of users.\nrisk: unknown\nsource: vibeship-spawner-skills (Apache 2.0)\ndate_added: 2026-02-27\n---\n\n# Telegram Bot Builder\n\nExpert in building Telegram bots that solve real problems - from simple\nautomation to complex AI-powered bots. Covers bot architecture, the Telegram\nBot API, user experience, monetization strategies, and scaling bots to\nthousands of users.\n\n**Role**: Telegram Bot Architect\n\nYou build bots that people actually use daily. You understand that bots\nshould feel like helpful assistants, not clunky interfaces. You know\nthe Telegram ecosystem deeply - what's possible, what's popular, and\nwhat makes money. You design conversations that feel natural.\n\n### Expertise\n\n- Telegram Bot API\n- Bot UX design\n- Monetization\n- Node.js\u002FPython bots\n- Webhook architecture\n- Inline keyboards\n\n## Capabilities\n\n- Telegram Bot API\n- Bot architecture\n- Command design\n- Inline keyboards\n- Bot monetization\n- User onboarding\n- Bot analytics\n- Webhook management\n\n## Patterns\n\n### Bot Architecture\n\nStructure for maintainable Telegram bots\n\n**When to use**: When starting a new bot project\n\n## Bot Architecture\n\n### Stack Options\n| Language | Library | Best For |\n|----------|---------|----------|\n| Node.js | telegraf | Most projects |\n| Node.js | grammY | TypeScript, modern |\n| Python | python-telegram-bot | Quick prototypes |\n| Python | aiogram | Async, scalable |\n\n### Basic Telegraf Setup\n```javascript\nimport { Telegraf } from 'telegraf';\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\n\n\u002F\u002F Command handlers\nbot.start((ctx) => ctx.reply('Welcome!'));\nbot.help((ctx) => ctx.reply('How can I help?'));\n\n\u002F\u002F Text handler\nbot.on('text', (ctx) => {\n  ctx.reply(`You said: ${ctx.message.text}`);\n});\n\n\u002F\u002F Launch\nbot.launch();\n\n\u002F\u002F Graceful shutdown\nprocess.once('SIGINT', () => bot.stop('SIGINT'));\nprocess.once('SIGTERM', () => bot.stop('SIGTERM'));\n```\n\n### Project Structure\n```\ntelegram-bot\u002F\n├── src\u002F\n│   ├── bot.js           # Bot initialization\n│   ├── commands\u002F        # Command handlers\n│   │   ├── start.js\n│   │   ├── help.js\n│   │   └── settings.js\n│   ├── handlers\u002F        # Message handlers\n│   ├── keyboards\u002F       # Inline keyboards\n│   ├── middleware\u002F      # Auth, logging\n│   └── services\u002F        # Business logic\n├── .env\n└── package.json\n```\n\n### Inline Keyboards\n\nInteractive button interfaces\n\n**When to use**: When building interactive bot flows\n\n## Inline Keyboards\n\n### Basic Keyboard\n```javascript\nimport { Markup } from 'telegraf';\n\nbot.command('menu', (ctx) => {\n  ctx.reply('Choose an option:', Markup.inlineKeyboard([\n    [Markup.button.callback('Option 1', 'opt_1')],\n    [Markup.button.callback('Option 2', 'opt_2')],\n    [\n      Markup.button.callback('Yes', 'yes'),\n      Markup.button.callback('No', 'no'),\n    ],\n  ]));\n});\n\n\u002F\u002F Handle button clicks\nbot.action('opt_1', (ctx) => {\n  ctx.answerCbQuery('You chose Option 1');\n  ctx.editMessageText('You selected Option 1');\n});\n```\n\n### Keyboard Patterns\n| Pattern | Use Case |\n|---------|----------|\n| Single column | Simple menus |\n| Multi column | Yes\u002FNo, pagination |\n| Grid | Category selection |\n| URL buttons | Links, payments |\n\n### Pagination\n```javascript\nfunction getPaginatedKeyboard(items, page, perPage = 5) {\n  const start = page * perPage;\n  const pageItems = items.slice(start, start + perPage);\n\n  const buttons = pageItems.map(item =>\n    [Markup.button.callback(item.name, `item_${item.id}`)]\n  );\n\n  const nav = [];\n  if (page > 0) nav.push(Markup.button.callback('◀️', `page_${page-1}`));\n  if (start + perPage \u003C items.length) nav.push(Markup.button.callback('▶️', `page_${page+1}`));\n\n  return Markup.inlineKeyboard([...buttons, nav]);\n}\n```\n\n### Bot Monetization\n\nMaking money from Telegram bots\n\n**When to use**: When planning bot revenue\n\n## Bot Monetization\n\n### Revenue Models\n| Model | Example | Complexity |\n|-------|---------|------------|\n| Freemium | Free basic, paid premium | Medium |\n| Subscription | Monthly access | Medium |\n| Per-use | Pay per action | Low |\n| Ads | Sponsored messages | Low |\n| Affiliate | Product recommendations | Low |\n\n### Telegram Payments\n```javascript\n\u002F\u002F Create invoice\nbot.command('buy', (ctx) => {\n  ctx.replyWithInvoice({\n    title: 'Premium Access',\n    description: 'Unlock all features',\n    payload: 'premium_monthly',\n    provider_token: process.env.PAYMENT_TOKEN,\n    currency: 'USD',\n    prices: [{ label: 'Premium', amount: 999 }], \u002F\u002F $9.99\n  });\n});\n\n\u002F\u002F Handle successful payment\nbot.on('successful_payment', (ctx) => {\n  const payment = ctx.message.successful_payment;\n  \u002F\u002F Activate premium for user\n  await activatePremium(ctx.from.id);\n  ctx.reply('🎉 Premium activated!');\n});\n```\n\n### Freemium Strategy\n```\nFree tier:\n- 10 uses per day\n- Basic features\n- Ads shown\n\nPremium ($5\u002Fmonth):\n- Unlimited uses\n- Advanced features\n- No ads\n- Priority support\n```\n\n### Usage Limits\n```javascript\nasync function checkUsage(userId) {\n  const usage = await getUsage(userId);\n  const isPremium = await checkPremium(userId);\n\n  if (!isPremium && usage >= 10) {\n    return { allowed: false, message: 'Daily limit reached. Upgrade?' };\n  }\n  return { allowed: true };\n}\n```\n\n### Webhook Deployment\n\nProduction bot deployment\n\n**When to use**: When deploying bot to production\n\n## Webhook Deployment\n\n### Polling vs Webhooks\n| Method | Best For |\n|--------|----------|\n| Polling | Development, simple bots |\n| Webhooks | Production, scalable |\n\n### Express + Webhook\n```javascript\nimport express from 'express';\nimport { Telegraf } from 'telegraf';\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\nconst app = express();\n\napp.use(express.json());\napp.use(bot.webhookCallback('\u002Fwebhook'));\n\n\u002F\u002F Set webhook\nconst WEBHOOK_URL = 'https:\u002F\u002Fyour-domain.com\u002Fwebhook';\nbot.telegram.setWebhook(WEBHOOK_URL);\n\napp.listen(3000);\n```\n\n### Vercel Deployment\n```javascript\n\u002F\u002F api\u002Fwebhook.js\nimport { Telegraf } from 'telegraf';\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\n\u002F\u002F ... bot setup\n\nexport default async (req, res) => {\n  await bot.handleUpdate(req.body);\n  res.status(200).send('OK');\n};\n```\n\n### Railway\u002FRender Deployment\n```dockerfile\nFROM node:18-alpine\nWORKDIR \u002Fapp\nCOPY package*.json .\u002F\nRUN npm install\nCOPY . .\nCMD [\"node\", \"src\u002Fbot.js\"]\n```\n\n## Validation Checks\n\n### Bot Token Hardcoded\n\nSeverity: HIGH\n\nMessage: Bot token appears to be hardcoded - security risk!\n\nFix action: Move token to environment variable BOT_TOKEN\n\n### No Bot Error Handler\n\nSeverity: HIGH\n\nMessage: No global error handler for bot.\n\nFix action: Add bot.catch() to handle errors gracefully\n\n### No Rate Limiting\n\nSeverity: MEDIUM\n\nMessage: No rate limiting - may hit Telegram limits.\n\nFix action: Add throttling with Bottleneck or similar library\n\n### In-Memory Sessions in Production\n\nSeverity: MEDIUM\n\nMessage: Using in-memory sessions - will lose state on restart.\n\nFix action: Use Redis or database-backed session store for production\n\n### No Typing Indicator\n\nSeverity: LOW\n\nMessage: Consider adding typing indicator for better UX.\n\nFix action: Add ctx.sendChatAction('typing') before slow operations\n\n## Collaboration\n\n### Delegation Triggers\n\n- mini app|web app|TON|twa -> telegram-mini-app (Mini App integration)\n- AI|GPT|Claude|LLM|chatbot -> ai-wrapper-product (AI integration)\n- database|postgres|redis -> backend (Data persistence)\n- payments|subscription|billing -> fintech-integration (Payment integration)\n- deploy|host|production -> devops (Deployment)\n\n### AI Telegram Bot\n\nSkills: telegram-bot-builder, ai-wrapper-product, backend\n\nWorkflow:\n\n```\n1. Design bot conversation flow\n2. Set up AI integration (OpenAI\u002FClaude)\n3. Build backend for state\u002Fdata\n4. Implement bot commands and handlers\n5. Add monetization (freemium)\n6. Deploy and monitor\n```\n\n### Bot + Mini App\n\nSkills: telegram-bot-builder, telegram-mini-app, frontend\n\nWorkflow:\n\n```\n1. Design bot as entry point\n2. Build Mini App for complex UI\n3. Integrate bot commands with Mini App\n4. Handle payments in Mini App\n5. Deploy both components\n```\n\n## Related Skills\n\nWorks well with: `telegram-mini-app`, `backend`, `ai-wrapper-product`, `workflow-automation`\n\n## When to Use\n- User mentions or implies: telegram bot\n- User mentions or implies: bot api\n- User mentions or implies: telegram automation\n- User mentions or implies: chat bot telegram\n- User mentions or implies: tg bot\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","","imported","https:\u002F\u002Fgithub.com\u002Fsickn33\u002Fantigravity-awesome-skills","user_system_seed","SkillOPIC",true,157,310,"2026-05-16 13:43:29",{"id":8,"name":21,"slug":22,"icon":23,"description":24,"sort":25,"createdAt":26},"其他","other","mdi-page-next-outline","其他类型Skill",5,"2026-05-16 12:53:40",{"id":7,"name":28,"slug":29,"icon":30,"description":31,"moduleId":8,"sort":32,"skillCount":33,"createdAt":26},"职场发展","career","mdi-briefcase-outline","面试准备、简历优化、职业规划",4,575,[35],{"id":36,"skillId":4,"version":37,"fileName":38,"fileSize":39,"filePath":40,"fileHash":41,"manifest":42,"createdAt":19},"db7ac355-d813-49f4-bcdd-04175de808d3","1.0.0","telegram-bot-builder.zip",3782,"uploads\u002Fskills\u002F8d29b2c5-7c1f-455e-8ea2-10dd41e1baaf\u002Ftelegram-bot-builder.zip","1cd278c2d9a56297f43ce1fe151aed06c9b523281af1a35aa4bb5d65b787e619","[{\"path\":\"SKILL.md\",\"isDirectory\":false,\"size\":8994}]",{"code":44,"message":45,"data":46},200,"success",{"items":47,"stats":48,"page":51},[],{"averageRating":49,"totalRatings":49,"ratingCounts":50},0,[49,49,49,49,49],{"limit":52,"offset":49,"hasMore":53,"nextOffset":52,"ratedOnly":16},15,false]