--- id: pytelegrambotapi version: "4.36.1" license: GPL2 license_treatment: copyleft maintenance: active --- # pyTelegramBotAPI — Python Telegram bot API. License: copyleft · Maintenance: active · Downloads: 1.2M/mo ## What it is and what it does pyTelegramBotAPI is a Python wrapper around the Telegram Bot API that lets you build bots without directly managing HTTP requests. It abstracts away API calls into a simple class-based interface with decorators for message handling, supporting both blocking (synchronous) and non-blocking (asynchronous) patterns. The library handles message routing, reply markup, inline queries, callback buttons, and other Telegram-specific features like polls and payment workflows. You define handlers—functions decorated with filters that match incoming messages—and the library dispatches incoming updates to the right handler. It manages the polling loop or webhook setup to keep your bot listening for messages. With aiohttp and requests as its only runtime dependencies, it stays lightweight while supporting modern Python versions from 3.10 onward. Use it for: - Build a command-driven bot that responds to /start, /help, and custom commands with static or dynamic replies. - Create an interactive bot with inline keyboards and callback queries for user navigation and form submission. - Set up a notification or alert bot that sends messages to users or channels based on external events or schedules. - Develop a bot that processes media (photos, documents, audio) and performs actions like storage, analysis, or forwarding. - Implement a polling-based or webhook-based bot that scales to handle multiple concurrent user conversations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A Python library that wraps the Telegram Bot API, providing both synchronous and asynchronous interfaces to build bots that send messages, handle user interactions, and manage Telegram chat operations. Yes, with conditions. The library is actively maintained, has no known vulnerabilities, and is production-stable for building Telegram bots. However, the GPLv2 copyleft license requires that any application using it be open-source or compatible with GPL terms—a significant constraint for proprietary projects. If your use case permits GPL licensing, this is a solid, well-established choice. ## Install pip install pytelegrambotapi uv add pytelegrambotapi poetry add pytelegrambotapi ## Installing pyTelegramBotAPI Before you install: Low install friction with a pure-Python wheel distribution. The package is actively maintained with a recent release and has been in development since 2015, indicating stable, long-term support. License in practice: Licensed under GPLv2 (copyleft). Any derivative work or application that bundles this library must also be distributed under GPLv2 or a compatible license, which may restrict commercial or proprietary use. Quickstart: pip install pyTelegramBotAPI import pytelegrambotapi bot = pytelegrambotapi.TeleBot("YOUR_BOT_TOKEN") @bot.message_handler(commands=['start']) def send_welcome(message): bot.reply_to(message, "Hello!") bot.infinity_polling() Requires a Telegram Bot API token obtained from @BotFather on Telegram; Python 3.10 or later. Verify before relying: - Whether the library fully supports all current Telegram Bot API features or has known limitations beyond those documented. - Performance characteristics when handling high-volume message throughput or concurrent async operations. - Whether middleware and custom filter systems are production-ready for complex bot logic. ## Package facts - License: GPL2 (copyleft) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags telegram bot api python, build telegram bots, telegram bot library, async telegram bot, telegram message handler, telegram bot framework, python telegram automation, telegram-bot, async-support, message-handling [View on SkillFed](https://skillfed.io/packages/pytelegrambotapi) · [View on PyPI](https://pypi.org/project/pytelegrambotapi/)