Skip to content
Lonami edited this page Sep 12, 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.

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! Telegram won't send a reply back at all if your system time is ahead of the current time (over just 400 seconds is enough, thanks @danog!), or > 400 seconds behind. 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.