Welcome to Telethon’s documentation!¶
Pure Python 3 Telegram client library. Official Site here. Please follow the links on the index below to navigate from here, or use the menu on the left. Remember to read the Changelog (Version History) when you upgrade!
Important
- Are you new here? Jump straight into Getting Started!
- Looking for available friendly methods? See telethon.client package.
- Used Telethon before v1.0? See Compatibility and Convenience.
- Need the full API reference? https://lonamiwebs.github.io/Telethon/.
What is this?¶
Telegram is a popular messaging application. This library is meant to make it easy for you to write Python programs that can interact with Telegram. Think of it as a wrapper that has already done the heavy job for you, so you can focus on developing an application.
Installation and Simple Usage¶
Advanced Usage¶
Examples¶
- Examples with the Client
- Authorization
- Group Chats
- Open Conversations and Joined Channels
- Downloading Media
- Getting Messages
- Exporting Messages
- Sending Messages
- Sending Markdown or HTML messages
- Sending Messages with Media
- Reusing Uploaded Files
- Sending Messages with Buttons
- Making Inline Queries
- Clicking Buttons
- Answering Inline Queries
- Conversations: Waiting for Messages or Replies
- Forwarding Messages
- Editing Messages
- Deleting Messages
- Marking Messages as Read
- Getting Entities
- Getting the Admin Log
- Working with messages
- Working with Chats and Channels
- Users
- Projects using Telethon
Troubleshooting¶
Developing¶
More¶
- Changelog (Version History)
- Fix-up for Photo Downloads (v1.7.1)
- Easier Events (v1.7)
- Tidying up Internals (v1.6)
- Layer Update (v1.5.5)
- Bug Fixes (v1.5.3)
- Takeout Sessions (v1.5.2)
- object.to_json() (v1.5.1)
- Polls with the Latest Layer (v1.5)
- Error Descriptions in CSV files (v1.4.3)
- Bug Fixes (v1.4.2)
- Connection Overhaul (v1.4)
- Event Templates (v1.3)
- Conversations, String Sessions and More (v1.2)
- Better Custom Message (v1.1.1)
- Bot Friendly (v1.1)
- New HTTP(S) Connection Mode (v1.0.4)
- Iterate Messages in Reverse (v1.0.3)
- Bug Fixes (v1.0.2)
- Bug Fixes (v1.0.1)
- Synchronous magic (v1.0)
- Core Rewrite in asyncio (v1.0-rc1)
- Custom Message class (v0.19.1)
- Catching up on Updates (v0.19)
- Pickle-able objects (v0.18.3)
- Several bug fixes (v0.18.2)
- Iterator methods (v0.18.1)
- Sessions overhaul (v0.18)
- Further easing library usage (v0.17.4)
- New small convenience functions (v0.17.3)
- New small convenience functions (v0.17.2)
- Updates as Events (v0.17.1)
- Trust the Server with Updates (v0.17)
- New
.resolve()
method (v0.16.2) - MtProto 2.0 (v0.16.1)
- Sessions as sqlite databases (v0.16)
- IPv6 support (v0.15.5)
- General enhancements (v0.15.4)
- Bug fixes with updates (v0.15.3)
- Bug fixes and new small features (v0.15.2)
- Custom Entity Database (v0.15.1)
- Updates Overhaul Update (v0.15)
- Serialization bug fixes (v0.14.2)
- Farewell, BinaryWriter (v0.14.1)
- Several requests at once and upload compression (v0.14)
- Quick fix-up (v0.13.6)
- Attempts at more stability (v0.13.5)
- More bug fixes and enhancements (v0.13.4)
- Bug fixes and enhancements (v0.13.3)
- New way to work with updates (v0.13.2)
- Invoke other requests from within update callbacks (v0.13.1)
- Connection modes (v0.13)
- Added verification for CDN file (v0.12.2)
- CDN support (v0.12.1)
- Newbie friendly update (v0.12)
- get_input_* now works with vectors (v0.11.5)
- get_input_* everywhere (v0.11.4)
- Quick .send_message() fix (v0.11.3)
- Callable TelegramClient (v0.11.2)
- Improvements to the updates (v0.11.1)
- Support for parallel connections (v0.11)
- JSON session file (v0.10.1)
- Full support for different DCs and ++stable (v0.10)
- Stability improvements (v0.9.1)
- General improvements (v0.9)
- Bot login and proxy support (v0.8)
- Long-run bug fix (v0.7.1)
- Two factor authentication (v0.7)
- Updated pip version (v0.6)
- Ready, pip, go! (v0.5)
- Made InteractiveTelegramClient cool (v0.4)
- Media revolution and improvements to update handling! (v0.3)
- Handle updates in their own thread! (v0.2)
- First working alpha version! (v0.1)
- Wall of Shame
Telethon modules
- telethon
- telethon package
- telethon.client module
- telethon.utils module
- telethon.helpers module
- telethon.events package
- telethon.sessions module
- telethon.errors package
- telethon.extensions package
- telethon.network package
- telethon.tl package
- telethon.tl.custom package
- telethon.tl.custom package
- telethon.tl.custom.draft module
- telethon.tl.custom.dialog module
- telethon.tl.custom.message module
- telethon.tl.custom.messagebutton module
- telethon.tl.custom.forward module
- telethon.tl.custom.button module
- telethon.tl.custom.inlinebuilder module
- telethon.tl.custom.inlineresult module
- telethon.tl.custom.inlineresults module
- telethon.tl.custom.chatgetter module
- telethon.tl.custom.sendergetter module
- telethon.tl.custom.conversation module
- telethon.tl.custom.adminlogevent module
- telethon.tl.tlobject module
- telethon.tl.custom package
- telethon.tl.custom package
- Module contents
- telethon package