Pure Python 3 MTProto API Telegram client library, for bots too!
Go to file
2016-09-05 19:12:14 +02:00
api Added custom errors, fixes to code generator 2016-09-05 18:35:12 +02:00
crypto Added custom errors, fixes to code generator 2016-09-05 18:35:12 +02:00
network Added custom errors, fixes to code generator 2016-09-05 18:35:12 +02:00
parser Improved auto-generated source code readability 2016-09-05 19:12:14 +02:00
tl Improved auto-generated source code readability 2016-09-05 19:12:14 +02:00
utils Added custom errors, fixes to code generator 2016-09-05 18:35:12 +02:00
.gitignore First attempt at TelegramClient. Added fixes and doc 2016-09-04 11:07:18 +02:00
errors.py Added custom errors, fixes to code generator 2016-09-05 18:35:12 +02:00
LICENSE Several fixes to authenticator, added more unit tests 2016-09-03 10:54:58 +02:00
main.py Added custom errors, fixes to code generator 2016-09-05 18:35:12 +02:00
README.md First attempt at TelegramClient. Added fixes and doc 2016-09-04 11:07:18 +02:00
scheme.tl Added custom errors, fixes to code generator 2016-09-05 18:35:12 +02:00
tl_generator.py Improved auto-generated source code readability 2016-09-05 19:12:14 +02:00
unit_test.py Improved auto-generated source code readability 2016-09-05 19:12:14 +02:00

Telethon

Telethon is Telegram client implementation in Python. This project's core is completely based on TLSharp. All the files which are fully based on it will have a notice on the top of the file. Also don't forget to have a look to the original project.

The files without the previously mentioned notice are no longer part of TLSharp itself, or have enough modifications to make them entirely different.

Requirements

This project requires the following Python modules, which can be installed by issuing sudo -H pip3 install <module> on a Linux terminal:

Also, you need to obtain your both API ID and Hash. Once you have them, head to api/ and create a copy of the settings_example file, naming it settings (lowercase!). Then fill the file with the corresponding values (your api_id, api_hash and phone number in international format). Now it is when you're ready to go!

Plans for the future

If everything works well, this probably ends up being a Python package :)

But as of now, and until that happens, help is highly appreciated!

Code generator limitations

The current code generator is not complete, yet adding the missing features would only over-complicate an already hard-to-read code. Some parts of the .tl file should be omitted, because they're "built-in" in the generated code (such as writing booleans, etc.).

In order to make sure that all the generated files will work, please make sure to always comment out these lines in scheme.tl (the latest version can always be found here):

// boolFalse#bc799737 = Bool;
// boolTrue#997275b5 = Bool;
// true#3fedd339 = True;
// vector#1cb5c415 {t:Type} # [ t ] = Vector t;

Also please make sure to rename updates#74ae4240 ... to updates_tg#74ae4240 ... or similar to avoid confusion between the updates folder and the updates.py file!