User:Lonami/sandbox

Telethon is a framework written purely in Python to interact with Telegram's API. It is MIT licensed.

The latest stable version of Telethon is 0.15.1 as of October 2017.

The library itself does not require other particular tools or libraries to be installed, besides Python itself and some other Python-based modules, and allows the user to interact with Telegram's API in the lowest level possible (through the use of "requests"), or with the use of some of the built-in abstractions the library features for an easier use.

One can easily extend the functionality of the library for easier use by overriding the central  class.

History
In 2016, Lonami had tried enhancing TLSharp to integrate automatically generated code that would implement all the types and requests defined in Telegram's Type Language, but the maintainer of the project refused to merge his work due to a misunderstanding of what the code exactly did, and Lonami eventually gave up to work on his own implementation. Later on, Afshin Arani made another pull request that finally got merged, and although he presumes he wrote the code generator, this hasn't been proven.

Some time later, Lonami moved to GNU Linux based distribution and started working with Python. Eventually, his own implementation turned to be written in Python, and the library was born.

Despite the lack of a major release, the stability of the library has been increasing and gaining more features with every release.

Features

 * Uses the latest version of Telegram's API
 * Full access to all the available requests and types
 * Built-in abstraction for common tasks
 * Easy to set up as a script or scheduled task
 * No dependendencies outside of Python
 * Update dispatching through a variable amount of workers

Example
The following source code shows how to login and send a message to yourself on Telegram: