Telegram Bot Developer

Telegram bot builder

by davila7 · MIT license · ★ 32,299 on GitHub

Telegram bot builder cover

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.

---
name: telegram-bot-builder
description: "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."
source: vibeship-spawner-skills (Apache 2.0)
---

# Telegram Bot Builder

**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.

## Capabilities

- Telegram Bot API

Overview

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.

What you get

  • Telegram Bot API
  • Bot architecture
  • Command design
  • Inline keyboards
  • Bot monetization
  • User onboarding
Manual install (npx, ZIP)
Claude Codenpx skills add davila7/claude-code-templates --skill telegram-bot-builder -g -a claude-code
Claude Code (degit)npx degit davila7/claude-code-templates/cli-tool/components/skills/enterprise-communication/telegram-bot-builder#main ~/.claude/skills/telegram-bot-builder
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md5.9 KB
Read SKILL.md here
davila7/main1 file shown
SKILL.md
Show the full text255 lines

Telegram Bot Builder

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.

Capabilities

  • Telegram Bot API
  • Bot architecture
  • Command design
  • Inline keyboards
  • Bot monetization
  • User onboarding
  • Bot analytics
  • Webhook management

Patterns

Bot Architecture

Structure for maintainable Telegram bots

When to use: When starting a new bot project

## 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
```javascript
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 Structure
telegram-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

### Inline Keyboards

Interactive button interfaces

**When to use**: When building interactive bot flows

```python
## Inline Keyboards

### Basic Keyboard
```javascript
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
Pagination
function 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]);
}

### Bot Monetization

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
```javascript
// 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 Strategy
Free tier:
- 10 uses per day
- Basic features
- Ads shown

Premium ($5/month):
- Unlimited uses
- Advanced features
- No ads
- Priority support
Usage Limits
async 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 };
}

## Anti-Patterns

### ❌ Blocking Operations

**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.

### ❌ No Error Handling

**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.

### ❌ Spammy Bot

**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.

## Related Skills

Works well with: `telegram-mini-app`, `backend`, `ai-wrapper-product`, `workflow-automation`
1---
2name: telegram-bot-builder
3description: "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."
4source: vibeship-spawner-skills (Apache 2.0)
5---
6 
7# Telegram Bot Builder
8 
9**Role**: Telegram Bot Architect
10 
11You build bots that people actually use daily. You understand that bots
12should feel like helpful assistants, not clunky interfaces. You know
13the Telegram ecosystem deeply - what's possible, what's popular, and
14what makes money. You design conversations that feel natural.
15 
16## Capabilities
17 
18- Telegram Bot API
19- Bot architecture
20- Command design
21- Inline keyboards
22- Bot monetization
23- User onboarding
24- Bot analytics
25- Webhook management
26 
27## Patterns
28 
29### Bot Architecture
30 
31Structure for maintainable Telegram bots
32 
33**When to use**: When starting a new bot project
34 
35```python
36## Bot Architecture
37 
38### Stack Options
39| Language | Library | Best For |
40|----------|---------|----------|
41| Node.js | telegraf | Most projects |
42| Node.js | grammY | TypeScript, modern |
43| Python | python-telegram-bot | Quick prototypes |
44| Python | aiogram | Async, scalable |
45 
46### Basic Telegraf Setup
47```javascript
48import { Telegraf } from 'telegraf';
49 
50const bot = new Telegraf(process.env.BOT_TOKEN);
51 
52// Command handlers
53bot.start((ctx) => ctx.reply('Welcome!'));
54bot.help((ctx) => ctx.reply('How can I help?'));
55 
56// Text handler
57bot.on('text', (ctx) => {
58 ctx.reply(`You said: ${ctx.message.text}`);
59});
60 
61// Launch
62bot.launch();
63 
64// Graceful shutdown
65process.once('SIGINT', () => bot.stop('SIGINT'));
66process.once('SIGTERM', () => bot.stop('SIGTERM'));
67```
68 
69### Project Structure
70```
71telegram-bot/
72├── src/
73│ ├── bot.js # Bot initialization
74│ ├── commands/ # Command handlers
75│ │ ├── start.js
76│ │ ├── help.js
77│ │ └── settings.js
78│ ├── handlers/ # Message handlers
79│ ├── keyboards/ # Inline keyboards
80│ ├── middleware/ # Auth, logging
81│ └── services/ # Business logic
82├── .env
83└── package.json
84```
85```
86 
87### Inline Keyboards
88 
89Interactive button interfaces
90 
91**When to use**: When building interactive bot flows
92 
93```python
94## Inline Keyboards
95 
96### Basic Keyboard
97```javascript
98import { Markup } from 'telegraf';
99 
100bot.command('menu', (ctx) => {
101 ctx.reply('Choose an option:', Markup.inlineKeyboard([
102 [Markup.button.callback('Option 1', 'opt_1')],
103 [Markup.button.callback('Option 2', 'opt_2')],
104 [
105 Markup.button.callback('Yes', 'yes'),
106 Markup.button.callback('No', 'no'),
107 ],
108 ]));
109});
110 
111// Handle button clicks
112bot.action('opt_1', (ctx) => {
113 ctx.answerCbQuery('You chose Option 1');
114 ctx.editMessageText('You selected Option 1');
115});
116```
117 
118### Keyboard Patterns
119| Pattern | Use Case |
120|---------|----------|
121| Single column | Simple menus |
122| Multi column | Yes/No, pagination |
123| Grid | Category selection |
124| URL buttons | Links, payments |
125 
126### Pagination
127```javascript
128function getPaginatedKeyboard(items, page, perPage = 5) {
129 const start = page * perPage;
130 const pageItems = items.slice(start, start + perPage);
131 
132 const buttons = pageItems.map(item =>
133 [Markup.button.callback(item.name, `item_${item.id}`)]
134 );
135 
136 const nav = [];
137 if (page > 0) nav.push(Markup.button.callback('◀️', `page_${page-1}`));
138 if (start + perPage < items.length) nav.push(Markup.button.callback('▶️', `page_${page+1}`));
139 
140 return Markup.inlineKeyboard([...buttons, nav]);
141}
142```
143```
144 
145### Bot Monetization
146 
147Making money from Telegram bots
148 
149**When to use**: When planning bot revenue
150 
151```javascript
152## Bot Monetization
153 
154### Revenue Models
155| Model | Example | Complexity |
156|-------|---------|------------|
157| Freemium | Free basic, paid premium | Medium |
158| Subscription | Monthly access | Medium |
159| Per-use | Pay per action | Low |
160| Ads | Sponsored messages | Low |
161| Affiliate | Product recommendations | Low |
162 
163### Telegram Payments
164```javascript
165// Create invoice
166bot.command('buy', (ctx) => {
167 ctx.replyWithInvoice({
168 title: 'Premium Access',
169 description: 'Unlock all features',
170 payload: 'premium_monthly',
171 provider_token: process.env.PAYMENT_TOKEN,
172 currency: 'USD',
173 prices: [{ label: 'Premium', amount: 999 }], // $9.99
174 });
175});
176 
177// Handle successful payment
178bot.on('successful_payment', (ctx) => {
179 const payment = ctx.message.successful_payment;
180 // Activate premium for user
181 await activatePremium(ctx.from.id);
182 ctx.reply('🎉 Premium activated!');
183});
184```
185 
186### Freemium Strategy
187```
188Free tier:
189- 10 uses per day
190- Basic features
191- Ads shown
192 
193Premium ($5/month):
194- Unlimited uses
195- Advanced features
196- No ads
197- Priority support
198```
199 
200### Usage Limits
201```javascript
202async function checkUsage(userId) {
203 const usage = await getUsage(userId);
204 const isPremium = await checkPremium(userId);
205 
206 if (!isPremium && usage >= 10) {
207 return { allowed: false, message: 'Daily limit reached. Upgrade?' };
208 }
209 return { allowed: true };
210}
211```
212```
213 
214## Anti-Patterns
215 
216### ❌ Blocking Operations
217 
218**Why bad**: Telegram has timeout limits.
219Users think bot is dead.
220Poor experience.
221Requests pile up.
222 
223**Instead**: Acknowledge immediately.
224Process in background.
225Send update when done.
226Use typing indicator.
227 
228### ❌ No Error Handling
229 
230**Why bad**: Users get no response.
231Bot appears broken.
232Debugging nightmare.
233Lost trust.
234 
235**Instead**: Global error handler.
236Graceful error messages.
237Log errors for debugging.
238Rate limiting.
239 
240### ❌ Spammy Bot
241 
242**Why bad**: Users block the bot.
243Telegram may ban.
244Annoying experience.
245Low retention.
246 
247**Instead**: Respect user attention.
248Consolidate messages.
249Allow notification control.
250Quality over quantity.
251 
252## Related Skills
253 
254Works well with: `telegram-mini-app`, `backend`, `ai-wrapper-product`, `workflow-automation`
255 
View all files on GitHub →

Details

License
MIT
Stars on the repo
★ 32,299
Checked
Source
davila7/claude-code-templates ↗
Creator
davila7 · 212 listings
View creator

Similar skills

See all →
SkillAPI Interface Designaddyosmani/agent-skills · by addyosmaniGuides stable API and interface design. Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.★ 98.7k GitHub starsAgentVersion-Specific Docs Lookupupstash/context7 · by upstashPulls up-to-date, version-specific library docs and code examples into the prompt so the AI stops inventing old APIs.★ 62.3k GitHub starsSkillAdaptyv Bio Foundry APIK-Dense-AI/scientific-agent-skills · by K-Dense-AIHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.★ 46k GitHub starsSkill.NET Backend Developerwshobson/agents · by wshobsonMaster C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.★ 39.9k GitHub starsSkillGemini Agent API Guidegoogle/skills · by googleGuides the usage of Gemini Interactions API on Gemini Enterprise Agent Platform. Use when the user wants to use the stateful, server-managed Interactions API for multi-turn conversations, background execution, streaming, structured output, and function calling on the Agent Platform.★ 20.9k GitHub starsSkillGemini Notebook Automationteng-lin/notebooklm-py · by teng-linInstall, authenticate, troubleshoot, and operate Gemini Notebook through the notebooklm-py CLI or typed async Python API. Use for notebook and source management, grounded chat and research, and artifact generation or download when the user mentions Gemini Notebook, notebooklm-py, the notebooklm CLI, or its Python API. Do not use for the generic Gemini API or unrelated content creation.★ 19.6k GitHub stars

More from davila7

Skill2D Game Developmentdavila7/claude-code-templates · by davila72D game development principles. Sprites, tilemaps, physics, camera.★ 32.3k GitHub starsSkill3D Game Development Principlesdavila7/claude-code-templates · by davila73D game development principles. Rendering, shaders, physics, cameras.★ 32.3k GitHub starsSkill3D Web Experience Builderdavila7/claude-code-templates · by davila7Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences. Use when: 3D website, three.js, WebGL, react three fiber, 3D experience.★ 32.3k GitHub starsSkillSplit Test Setupdavila7/claude-code-templates · by davila7When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," or "hypothesis." For tracking implementation, see analytics-tracking.★ 32.3k GitHub starsAgentResearch Literature Synthesizerdavila7/claude-code-templates · by davila7Academic research synthesis specialist. Use PROACTIVELY for comprehensive research on academic topics, literature reviews, technical investigations, and well-cited analysis combining multiple sources. <example>Context: A podcast episode needs a segment grounded in peer-reviewed evidence with formal citations. user: "Research the current state of transformer efficiency techniques for the episode, with proper academic citations." assistant: "I'll use the academic-research-synthesizer agent to search arXiv and Semantic Scholar, extract full-text findings via WebFetch, and produce a cited literature synthesis with confidence levels." <commentary>Use academic-research-synthesizer (not comprehensive-researcher) when the episode segment needs peer-reviewed sourcing, formal citation format, and explicit confidence tagging rather than general-purpose multi-source coverage.</commentary></example> <example>Context: The episode-orchestrator has routed a "literature review" request for a technical deep-dive segment. user: "Summarize the research landscape on federated learning privacy guarantees." assistant: "I'll invoke academic-research-synthesizer to systematically search academic sources, note peer-review status per source, and synthesize consensus vs. open debates."</example>★ 32.3k GitHub starsAgentAcademic Research Specialistdavila7/claude-code-templates · by davila7Academic research specialist for scholarly sources, peer-reviewed papers, and academic literature. Use PROACTIVELY for research paper analysis, literature reviews, citation tracking, and academic methodology evaluation. <example>Context: The research-orchestrator has kicked off Phase 4 parallel research on 'efficacy of intermittent fasting' and needs peer-reviewed evidence. user: "Find the academic evidence on intermittent fasting outcomes." assistant: "I'll use the academic-researcher agent to search Semantic Scholar, PubMed, and OpenAlex for peer-reviewed studies and write structured findings to academic-research.md." <commentary>The request is specifically for scholarly/peer-reviewed evidence rather than general web coverage or code, so academic-researcher (not web-researcher or technical-researcher) is the right specialist.</commentary></example> <example>Context: The user wants a literature review comparing methodologies across studies on a topic. user: "Can you review the literature on transformer model interpretability and identify research gaps?" assistant: "Let me invoke the academic-researcher agent to pull foundational and recent papers, extract methodologies, and surface open research gaps." <commentary>Literature review, methodology extraction, and research-gap identification are core academic-researcher capabilities, distinct from technical-researcher's focus on code repositories and implementations.</commentary></example>★ 32.3k GitHub stars