跳到正文
Skillpedia
API 与服务器(后端)48k · #5950

telegram-bot-builder

它能做什么

这位专家可以帮你搭建 Telegram 机器人(bot)。从基本结构到变现方式,它会教你如何制作用于自动化任务的简单机器人,或功能更复杂、由 AI 驱动的机器人。

适用场景

  • ✓当你想创建一个机器人来自动完成重复性工作时。
  • ✓当你有一个 Telegram 机器人的想法,但不知道从哪里开始时。
  • ✓当你想学习如何通过 Telegram 机器人赚钱时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/telegram-bot-builder/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/telegram-bot-builder/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想做一个 Telegram 机器人,每天给我的朋友发送提醒。应该怎么做?”

每周 5 个新技能,1 分钟读完。

工作原理

它会带你了解机器人的结构,教你如何使用 Telegram 官方提供的工具(API),并让用户能轻松地与机器人互动。它还会讲解如何变现,以及如何让机器人扩展到支持大量用户。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Telegram Bot Builder

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.

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.

Expertise

  • Telegram Bot API
  • Bot UX design
  • Monetization
  • Node.js/Python bots
  • Webhook architecture
  • Inline keyboards

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

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

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

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

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

…
常见问题

什么是 Telegram Bot API?

这是 Telegram 提供的一套规则和工具,开发者可以借此创建自己的机器人。

什么是“内联键盘”(Inline Keyboards)?

这是直接显示在 Telegram 聊天中的交互式按钮,让与机器人的互动更便捷、更直观。

机器人如何赚钱?

方式有很多,比如提供付费的额外功能(免费增值模式)、按月收取订阅费、按次收费、展示广告,或者推荐第三方产品。

详情

作者的原始描述

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.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5950
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能