Telethon
Full-featured Telegram client library for Python 3
Decision gist · record as of 2026-08-14
Yes, if you need to interact with Telegram from Python and can obtain API credentials. The library is actively maintained, has low install friction, carries no known vulnerabilities, and is MIT-licensed. Be aware that Telegram's ToS prohibit certain uses and account bans are possible—read the documentation's compatibility and FAQ sections before deploying to a production account.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- You must obtain api_id and api_hash from https://my.telegram.org under API Development before the client can connect.
- Low install friction with only two runtime dependencies (pyaes, rsa).
- Maintenance status is active with a release within the last 60 days.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use, modification, and distribution with minimal restrictions—suitable for most projects.
last release 2026-06-15 (60 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,727,765 downloads/mo, #2,515 on PyPI
Alternatives
Verify before relying
pip install telethon
from telethon import TelegramClient, events
api_id = 12345
api_hash = '0123456789abcdef0123456789abcdef'
client = TelegramClient('session_name', api_id, api_hash)
client.start()
client.send_message('username', 'Hello from Telethon')- Whether account bans or limitations occur in practice when using the library, despite ToS warnings in the documentation.
- Current compatibility with the latest Telegram protocol changes beyond what the release date suggests.
What it is and what it does
Telethon wraps Telegram's MTProto protocol in a Python 3 asyncio library, letting you write programs that send messages, download media, handle events, and automate interactions with Telegram accounts or bots. It handles the cryptographic and protocol complexity so you can focus on application logic rather than low-level API details.
The library supports both user accounts and bot accounts, offering an alternative to Telegram's official bot API when you need user-level access or more direct control. It requires obtaining API credentials from Telegram's developer portal and respects Python 3.5 and later. The two core dependencies (pyaes for encryption and rsa for key handling) are lightweight, keeping installation straightforward.
Use it for
- Automate sending messages or files to Telegram contacts or groups from a Python script.
- Build a bot that listens for incoming messages and responds to patterns or commands.
- Download and archive media from Telegram conversations programmatically.
- Monitor a Telegram channel or group and trigger actions based on new messages.
- Migrate data or integrate Telegram messaging into a larger application workflow.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to interact with Telegram from Python and can obtain API credentials.
The library is actively maintained, has low install friction, carries no known vulnerabilities, and is MIT-licensed. Be aware that Telegram's ToS prohibit certain uses and account bans are possible—read the documentation's compatibility and FAQ sections before deploying to a production account.
Install
telethon on PyPI
Before you install
Low install friction with only two runtime dependencies (pyaes, rsa). Maintenance status is active with a release within the last 60 days. The library is in maintenance mode for v1, accepting bug fixes and layer updates.
You must obtain api_id and api_hash from https://my.telegram.org under API Development before the client can connect.
License in practice
MIT license permits commercial and private use, modification, and distribution with minimal restrictions—suitable for most projects.
Quickstart
pip install telethon
from telethon import TelegramClient, events
api_id = 12345
api_hash = '0123456789abcdef0123456789abcdef'
client = TelegramClient('session_name', api_id, api_hash)
client.start()
client.send_message('username', 'Hello from Telethon')
Verify before relying
- Whether account bans or limitations occur in practice when using the library, despite ToS warnings in the documentation.
- Current compatibility with the latest Telegram protocol changes beyond what the release date suggests.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.5 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagespyaesrsa |
| Maintenance | Actively maintained 60 days since the last release |
| First released | |
| Downloads | 3,727,765 / month, #2,515 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Communications :: Chat |
Evidence: telethon-1.44.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “telegram bot alternative”
- TelethonTelethon is an asyncio-based Python library that implements the…
- python-telegram-botProvides a pure Python asynchronous interface to the Telegram Bot…
- telebotA Telegram bot library with route-based message handling that wraps…
Give your agent the search over MCP, or paste the wish link into any chat.
More Chat packages
Provides Python bindings for Slack's Web API, webhooks, Socket Mode, OAuth, and other platform APIs, enabling apps to send messages, manage files, verify requests, and interact with Slack workspaces.
Install it if you need to integrate Python applications with Slack—whether for bots, notifications, or custom workflows.
Provides a pure Python asynchronous interface to the Telegram Bot API, with convenience methods and high-level classes for building chatbots.
Install it if you need to build or integrate with Telegram bots in Python.
Provides Python interfaces to Slack's Web API and Real Time Messaging (RTM) API for building Slack applications and bots.
Install only if you are maintaining legacy code or have a specific reason not to migrate.
aiogram is an asynchronous Python framework for building Telegram bots using asyncio and aiohttp, with type hints, routing, state machines, and middleware support.
Serializes and deserializes machine learning pipelines to a portable Bundle.ML format for cross-platform deployment and execution.
Open WebUI is a self-hosted AI platform providing a web interface for interacting with local and remote language models, with built-in RAG, multi-model conversations, and plugin extensibility.
However, the custom proprietary license with strict branding restrictions is a material constraint: if you plan to heavily customize or deploy at scale, you will need…
See also pytgcalls · pyrofork · Kurigram · Pyrogram · pyTelegramBotAPI · telebot · TgCrypto · nonebot2