{"slug":"telegram-bot-builder","title":"telegram-bot-builder","summary":"Expert in building Telegram bots that solve real problems - from","platform":"ChatGPT","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-08-16T13:39:01.821635Z","repo":{"url":"https://github.com/sickn33/agentic-awesome-skills","stars":46883,"forks":6831,"license":"MIT","updatedAt":"2026-09-25T05:43:16Z"},"bodyHtml":"<hr>\n<h2>name: telegram-bot-builder\ndescription: Expert in building Telegram bots that solve real problems - from\nsimple automation to complex AI-powered bots. Covers bot architecture, the\nTelegram Bot API, user experience, monetization strategies, and scaling bots\nto thousands of users.\nrisk: critical\nsource: vibeship-spawner-skills (Apache 2.0)\ndate_added: 2026-02-27</h2>\n<h1>Telegram Bot Builder</h1>\n<p>Expert 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.</p>\n<p><strong>Role</strong>: Telegram Bot Architect</p>\n<p>You 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.</p>\n<h3>Expertise</h3>\n<ul>\n<li>Telegram Bot API</li>\n<li>Bot UX design</li>\n<li>Monetization</li>\n<li>Node.js/Python bots</li>\n<li>Webhook architecture</li>\n<li>Inline keyboards</li>\n</ul>\n<h2>Capabilities</h2>\n<ul>\n<li>Telegram Bot API</li>\n<li>Bot architecture</li>\n<li>Command design</li>\n<li>Inline keyboards</li>\n<li>Bot monetization</li>\n<li>User onboarding</li>\n<li>Bot analytics</li>\n<li>Webhook management</li>\n</ul>\n<h2>Patterns</h2>\n<h3>Bot Architecture</h3>\n<p>Structure for maintainable Telegram bots</p>\n<p><strong>When to use</strong>: When starting a new bot project</p>\n<h2>Bot Architecture</h2>\n<h3>Stack Options</h3>\n<table>\n<thead>\n<tr>\n<th>Language</th>\n<th>Library</th>\n<th>Best For</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Node.js</td>\n<td>telegraf</td>\n<td>Most projects</td>\n</tr>\n<tr>\n<td>Node.js</td>\n<td>grammY</td>\n<td>TypeScript, modern</td>\n</tr>\n<tr>\n<td>Python</td>\n<td>python-telegram-bot</td>\n<td>Quick prototypes</td>\n</tr>\n<tr>\n<td>Python</td>\n<td>aiogram</td>\n<td>Async, scalable</td>\n</tr>\n</tbody>\n</table>\n<h3>Basic Telegraf Setup</h3>\n<pre><code>import { Telegraf } from 'telegraf';\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\n\n// Command handlers\nbot.start((ctx) =&gt; ctx.reply('Welcome!'));\nbot.help((ctx) =&gt; ctx.reply('How can I help?'));\n\n// Text handler\nbot.on('text', (ctx) =&gt; {\n  ctx.reply(`You said: ${ctx.message.text}`);\n});\n\n// Launch\nbot.launch();\n\n// Graceful shutdown\nprocess.once('SIGINT', () =&gt; bot.stop('SIGINT'));\nprocess.once('SIGTERM', () =&gt; bot.stop('SIGTERM'));\n</code></pre>\n<h3>Project Structure</h3>\n<pre><code>telegram-bot/\n├── src/\n│   ├── bot.js           # Bot initialization\n│   ├── commands/        # Command handlers\n│   │   ├── start.js\n│   │   ├── help.js\n│   │   └── settings.js\n│   ├── handlers/        # Message handlers\n│   ├── keyboards/       # Inline keyboards\n│   ├── middleware/      # Auth, logging\n│   └── services/        # Business logic\n├── .env\n└── package.json\n</code></pre>\n<h3>Inline Keyboards</h3>\n<p>Interactive button interfaces</p>\n<p><strong>When to use</strong>: When building interactive bot flows</p>\n<h2>Inline Keyboards</h2>\n<h3>Basic Keyboard</h3>\n<pre><code>import { Markup } from 'telegraf';\n\nbot.command('menu', (ctx) =&gt; {\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// Handle button clicks\nbot.action('opt_1', (ctx) =&gt; {\n  ctx.answerCbQuery('You chose Option 1');\n  ctx.editMessageText('You selected Option 1');\n});\n</code></pre>\n<h3>Keyboard Patterns</h3>\n<table>\n<thead>\n<tr>\n<th>Pattern</th>\n<th>Use Case</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Single column</td>\n<td>Simple menus</td>\n</tr>\n<tr>\n<td>Multi column</td>\n<td>Yes/No, pagination</td>\n</tr>\n<tr>\n<td>Grid</td>\n<td>Category selection</td>\n</tr>\n<tr>\n<td>URL buttons</td>\n<td>Links, payments</td>\n</tr>\n</tbody>\n</table>\n<h3>Pagination</h3>\n<pre><code>function 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 =&gt;\n    [Markup.button.callback(item.name, `item_${item.id}`)]\n  );\n\n  const nav = [];\n  if (page &gt; 0) nav.push(Markup.button.callback('◀️', `page_${page-1}`));\n  if (start + perPage &lt; items.length) nav.push(Markup.button.callback('▶️', `page_${page+1}`));\n\n  return Markup.inlineKeyboard([...buttons, nav]);\n}\n</code></pre>\n<h3>Bot Monetization</h3>\n<p>Making money from Telegram bots</p>\n<p><strong>When to use</strong>: When planning bot revenue</p>\n<h2>Bot Monetization</h2>\n<h3>Revenue Models</h3>\n<table>\n<thead>\n<tr>\n<th>Model</th>\n<th>Example</th>\n<th>Complexity</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Freemium</td>\n<td>Free basic, paid premium</td>\n<td>Medium</td>\n</tr>\n<tr>\n<td>Subscription</td>\n<td>Monthly access</td>\n<td>Medium</td>\n</tr>\n<tr>\n<td>Per-use</td>\n<td>Pay per action</td>\n<td>Low</td>\n</tr>\n<tr>\n<td>Ads</td>\n<td>Sponsored messages</td>\n<td>Low</td>\n</tr>\n<tr>\n<td>Affiliate</td>\n<td>Product recommendations</td>\n<td>Low</td>\n</tr>\n</tbody>\n</table>\n<h3>Telegram Payments</h3>\n<pre><code>// Create invoice\nbot.command('buy', (ctx) =&gt; {\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 }], // $9.99\n  });\n});\n\n// Handle successful payment\nbot.on('successful_payment', (ctx) =&gt; {\n  const payment = ctx.message.successful_payment;\n  // Activate premium for user\n  await activatePremium(ctx.from.id);\n  ctx.reply('\uD83C\uDF89 Premium activated!');\n});\n</code></pre>\n<h3>Freemium Strategy</h3>\n<pre><code>Free tier:\n- 10 uses per day\n- Basic features\n- Ads shown\n\nPremium ($5/month):\n- Unlimited uses\n- Advanced features\n- No ads\n- Priority support\n</code></pre>\n<h3>Usage Limits</h3>\n<pre><code>async function checkUsage(userId) {\n  const usage = await getUsage(userId);\n  const isPremium = await checkPremium(userId);\n\n  if (!isPremium &amp;&amp; usage &gt;= 10) {\n    return { allowed: false, message: 'Daily limit reached. Upgrade?' };\n  }\n  return { allowed: true };\n}\n</code></pre>\n<h3>Webhook Deployment</h3>\n<p>Production bot deployment</p>\n<p><strong>When to use</strong>: When deploying bot to production</p>\n<h2>Webhook Deployment</h2>\n<h3>Polling vs Webhooks</h3>\n<table>\n<thead>\n<tr>\n<th>Method</th>\n<th>Best For</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Polling</td>\n<td>Development, simple bots</td>\n</tr>\n<tr>\n<td>Webhooks</td>\n<td>Production, scalable</td>\n</tr>\n</tbody>\n</table>\n<h3>Express + Webhook</h3>\n<pre><code>import 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('/webhook'));\n\n// Set webhook\nconst WEBHOOK_URL = 'https://your-domain.com/webhook';\nbot.telegram.setWebhook(WEBHOOK_URL);\n\napp.listen(3000);\n</code></pre>\n<h3>Vercel Deployment</h3>\n<pre><code>// api/webhook.js\nimport { Telegraf } from 'telegraf';\n\nconst bot = new Telegraf(process.env.BOT_TOKEN);\n// ... bot setup\n\nexport default async (req, res) =&gt; {\n  await bot.handleUpdate(req.body);\n  res.status(200).send('OK');\n};\n</code></pre>\n<h3>Railway/Render Deployment</h3>\n<pre><code>FROM node:18-alpine\nWORKDIR /app\nCOPY package*.json ./\nRUN npm install\nCOPY . .\nCMD [\"node\", \"src/bot.js\"]\n</code></pre>\n<h2>Validation Checks</h2>\n<h3>Bot Token Hardcoded</h3>\n<p>Severity: HIGH</p>\n<p>Message: Bot token appears to be hardcoded - security risk!</p>\n<p>Fix action: Move token to environment variable BOT_TOKEN</p>\n<h3>No Bot Error Handler</h3>\n<p>Severity: HIGH</p>\n<p>Message: No global error handler for bot.</p>\n<p>Fix action: Add bot.catch() to handle errors gracefully</p>\n<h3>No Rate Limiting</h3>\n<p>Severity: MEDIUM</p>\n<p>Message: No rate limiting - may hit Telegram limits.</p>\n<p>Fix action: Add throttling with Bottleneck or similar library</p>\n<h3>In-Memory Sessions in Production</h3>\n<p>Severity: MEDIUM</p>\n<p>Message: Using in-memory sessions - will lose state on restart.</p>\n<p>Fix action: Use Redis or database-backed session store for production</p>\n<h3>No Typing Indicator</h3>\n<p>Severity: LOW</p>\n<p>Message: Consider adding typing indicator for better UX.</p>\n<p>Fix action: Add ctx.sendChatAction('typing') before slow operations</p>\n<h2>Collaboration</h2>\n<h3>Delegation Triggers</h3>\n<ul>\n<li>mini app|web app|TON|twa -&gt; telegram-mini-app (Mini App integration)</li>\n<li>AI|GPT|Claude|LLM|chatbot -&gt; ai-wrapper-product (AI integration)</li>\n<li>database|postgres|redis -&gt; backend (Data persistence)</li>\n<li>payments|subscription|billing -&gt; fintech-integration (Payment integration)</li>\n<li>deploy|host|production -&gt; devops (Deployment)</li>\n</ul>\n<h3>AI Telegram Bot</h3>\n<p>Skills: telegram-bot-builder, ai-wrapper-product, backend</p>\n<p>Workflow:</p>\n<pre><code>1. Design bot conversation flow\n2. Set up AI integration (OpenAI/Claude)\n3. Build backend for state/data\n4. Implement bot commands and handlers\n5. Add monetization (freemium)\n6. Deploy and monitor\n</code></pre>\n<h3>Bot + Mini App</h3>\n<p>Skills: telegram-bot-builder, telegram-mini-app, frontend</p>\n<p>Workflow:</p>\n<pre><code>1. 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</code></pre>\n<h2>Related Skills</h2>\n<p>Works well with: <code>telegram-mini-app</code>, <code>backend</code>, <code>ai-wrapper-product</code>, <code>workflow-automation</code></p>\n<h2>When to Use</h2>\n<ul>\n<li>User mentions or implies: telegram bot</li>\n<li>User mentions or implies: bot api</li>\n<li>User mentions or implies: telegram automation</li>\n<li>User mentions or implies: chat bot telegram</li>\n<li>User mentions or implies: tg bot</li>\n</ul>\n<h2>Limitations</h2>\n<ul>\n<li>Use this skill only when the task clearly matches the scope described above.</li>\n<li>Do not treat the output as a substitute for environment-specific validation, testing, or expert review.</li>\n<li>Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.</li>\n</ul>\n","files":[{"path":"SKILL.md","sizeBytes":8995,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"notes-only","suspicious":0,"notes":2,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-08-16T13:46:43.452263Z","sha256":"139201BEE06D192A70C83A672921C7B3E5C558764D7ADE3BEBD29F0F2A75B597","sizeBytes":3792},"review":null,"source":{"repositoryUrl":"https://github.com/sickn33/agentic-awesome-skills","path":"skills/telegram-bot-builder","license":"MIT","commit":"f2bba339de74414b0771234cbe4f6a15258e32a3","subtreeSha":"8D842C3B7BED91ACFD0D10F8B746F218C940E3362FAF192A66494342A41D9DAF","lastSyncedAt":"2026-09-25T06:48:39.853703Z"},"reviewedAt":"2026-08-16T13:57:23.442777Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/sickn33/agentic-awesome-skills/tree/main/skills/telegram-bot-builder"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install sickn33-agentic-awesome-skills@llmmart"},{"target":"git","command":"git clone https://github.com/sickn33/agentic-awesome-skills.git"}]}