Skip to content
Lonami edited this page Sep 25, 2017 · 27 revisions

Welcome to the wiki! This place hosts all the information you need in order to work with this library. Telethon is a Telegram client implementation in Python which uses the latest available API of Telegram. Check the links on the sidebar for more!

Before opening an issue about how to use the library, please make sure you've investigated and read the wiki enough! Issues lacking of any sense at all end on the Wall of Shame.

Also please make sure to read the change log (over Releases) when you update the library through pip install --upgrade telethon, since the library, although has been around for quite a while, may still introduce some breaking changes from time to time which will be listed there.

The library will by default report RPC errors to rpc.pwrtelegram.xyz. For more information, please check the API Status wiki page.

Why Telethon?

Why should I bother with Telethon? There are more mature projects already, such as telegram-cli with even (limited) Python support. And we have the official clients!

With Telethon you don't really need to know anything before using it. Create a client with your settings. Connect. You're ready to go.

Being written entirely on Python, Telethon can run as a script under any environment you wish, (yes, Android too). You can schedule it, or use it in any other script you have. Want to send a message to someone when you're available? Write a script. Do you want check for new messages at a given time and find relevant ones? Write a script.

It is very important that your system time is on sync! The library will do its best as long as the current time is not behind 30 seconds in the past, and 300 in the future, but the server may not reply at all for larger differences, thanks @danog for the information. This will most likely be the cause for the following errors:

BlockingIOError: [Errno 11] Resource temporarily unavailable
BlockingIOError: [Errno 35] Resource temporarily unavailable
TimeoutError: The read operation exceeded the timeout.

Please check this out before opening an issue. Thanks to issue 172 for the debug level log.

The online documentation for all available requests, types and constructors is available online at https://lonamiwebs.github.io/Telethon/.

Possible problems

If you ever receive a PEER_FLOOD error or aren't able to perform certain requests, it might mean that your account is limited, and there's not much Telethon can do about this. Talk to @SpamBot for more information, or refer to the spam FAQ.