GithubHelp home page GithubHelp logo

pytglib's Introduction

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

pytglib's People

Contributors

amirsbss avatar webshark025 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.