- Home
- Skills
- Davila7
- Claude Code Templates
- Telegram Bot Builder
telegram-bot-builder_skill
- Python
20.6k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill davila7/claude-code-templates --skill telegram-bot-builder- SKILL.md8.7 KB
Overview
This skill provides practical, production-ready guidance for building Telegram bots with Node.js and Python. It covers authentication, receiving updates (polling vs webhooks), message formats, keyboards, media, payments, state management, error handling, and deployment patterns. Use it to design, implement, and operate bots that scale and comply with Telegram API constraints.
How this skill works
The skill inspects common Telegram Bot API workflows and translates them into concrete patterns and code snippets for libraries like node-telegram-bot-api, grammy, telegraf, python-telegram-bot, and aiogram. It explains token handling, webhook configuration, update handling, interactive elements (inline/reply keyboards and callback queries), media uploads, and best-practice deployment options such as Docker, PM2, and serverless webhooks. The guidance includes error and rate-limit handling, state management strategies, and security recommendations.
When to use it
- Creating a new Telegram bot from scratch or adding Telegram messaging to an app
- Choosing between long polling (getUpdates) for development and webhooks for production
- Implementing interactive features: inline keyboards, callback queries, inline mode
- Sending and receiving media, documents, albums, or implementing payments
- Deploying and monitoring a bot in production (Docker, PM2, serverless, VPS)
Best practices
- Store BOT_TOKEN in environment variables and never commit it to source control
- Use polling for dev, webhooks with HTTPS and secret token validation for production
- Keep conversation state per chat (in-memory Map for small bots, Redis for scale)
- Always call answerCallbackQuery for callback_data and respect the 64-byte limit
- Implement exponential backoff for 429 responses and handle common API errors
- Validate admin user IDs, sanitize inputs before DB storage, and restrict allowed_updates
Example use cases
- A support chatbot that collects user info via a multi-step conversation handler
- A content bot that posts media albums and reuses file_id for uploads to save bandwidth
- An e-commerce bot that sends invoices and handles pre-checkout queries for payments
- An inline search bot that returns InlineQueryResult items for in-chat results
- Deploying a webhook handler on AWS Lambda or Vercel for a low-cost serverless bot
FAQ
Use webhooks in production for lower latency and better scalability; polling is fine for development and small bots without HTTPS.
How do I handle rate limits and 429 errors?
Read retry_after from the response, wait that duration, and use exponential backoff. Spread messages across chats to avoid per-chat limits.