Skip to main content

Python library to help you build your own Telegram clients

Project description

Python-Telegram

Welcome to Python-Telegram! Python-Telegram is a python wrapper for tdlib, completely Object-Oriented and originally based on tdlib's suggested libs for python.

Installation

Installing the library is super easy. First, be sure to have Python3 installed in your server: apt install python3

Then, simply execute the installation script: python3 setup.py install

And you're ready to go!

A simple script

Here's a simple script that prints every update it receives from Telegram:

from pytglib.client import Telegram

# Change the values below
api_id = 7
api_hash = '123412341234123412341234'
phone_number = '+12312312312'
dbenc = '32_hexademical_chars'

# Initiate the client
client = Telegram(api_id=api_id, api_hash=api_hash, phone=phone_number, database_encryption_key=dbenc)

# Login to the client
client.login() 

# Define the handler function
def my_message_handler(update):
    print(update)

# Register it
client.add_message_handler(my_message_handler)

tg.idle()

# And you're ready to go!

For more complex scripts, go to the Examples section below:

Documentation and examples

The documentation is not complete at the moment, but you can see some examples in examples tree. Of course, we're doing our best to finish the documentation as soon as possible. By the way, there's an auto generated documentation here; It can help to find out about types and functions of the library.

Bugs and questions

If there is any buys or questions about the library, feel free to contact any member of our team on Telegram:

https://telegram.me/Amir_H https://telegram.me/wsh25

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Pytglib-0.4.tar.gz (255.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Pytglib-0.4-py3-none-any.whl (780.2 kB view details)

Uploaded Python 3

File details

Details for the file Pytglib-0.4.tar.gz.

File metadata

  • Download URL: Pytglib-0.4.tar.gz
  • Upload date:
  • Size: 255.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for Pytglib-0.4.tar.gz
Algorithm Hash digest
SHA256 8aa84e4129a35ef8629ad255528acdaf72a915fe2646b6e0abec6fe2b9a26406
MD5 83151af09ec13fa21c5a461fb6554cbd
BLAKE2b-256 f8f976e47974ad0e6660cad753d0b88800cfe5cc24511f29c08919ba2e2068f3

See more details on using hashes here.

File details

Details for the file Pytglib-0.4-py3-none-any.whl.

File metadata

  • Download URL: Pytglib-0.4-py3-none-any.whl
  • Upload date:
  • Size: 780.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for Pytglib-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 95d9ef846e034f842ac2b3ab6eb3a4b6864670ecb7b5dc33d24c1bd0139d3047
MD5 d730bd08a75a7f62c936bbfdcda4b47f
BLAKE2b-256 44646f47f57c1ef4d16e2f2f89bc7e42c13aeb2721d55768a3157fbb436c2420

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page