GithubHelp home page GithubHelp logo

sourayen / pyrography Goto Github PK

View Code? Open in Web Editor NEW

This project forked from d3cryptofc/pyrography

0.0 0.0 0.0 7.57 MB

A wonderful Pyrogram fork inspired by Pyromod & AmanoTeam/Pyrogram.

Home Page: https://pypi.org/project/pyrography

License: GNU Lesser General Public License v3.0

Python 99.95% Makefile 0.05%

pyrography's Introduction

Pyrogram
Telegram MTProto API Framework for Python
A wonderful Pyrogram fork inspired by Pyromod & AmanoTeam/Pyrogram
Releases โ€ข News

Pyrography

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots

from pyrography import Client, filters


# Creating a client instance to control your bot.
# NOTE: Get your `api_id` and `api_hash` credentials on: my.telegram.org.
# (optional `bot_token` parameter)
client = Client(
    name='your_session_name',
    api_id=...,
    api_hash=...
)


@client.on_message(filters.command('start'))
async def ask_user_name(client, message):
    # Ask the user age.
    asking = message.ask("What's your name?", quote=True)

    # Getting ask message and answer message.
    # TIP: you can to use `async for` too!
    ask, answer = await anext(asking)

    # Getting message text.
    user_name = answer.text

    # Replying message, without quote.
    await answer.reply(f'Nice name, {user_name}!', quote=False)


if __name__ == '__main__':
    # Starting client and listening for updates.
    client.run()

Pyrography is a modern, elegant and asynchronous MTProto API framework. It enables you to easily interact with the main Telegram API through a user account (custom client) or a bot identity (bot API alternative) using Python.

Why should you use Pyrography?

1. Stop safety

Pyrography is the only mtproto library currently that when pressing CTRL + C to interrupt the program, it will wait for pending commands to finish, preventing anything from being incomplete.

To most performance and others

1. Fast cryptography (TgCrypto)

A Cryptography Library written in C as a Python extension. It is designed to be portable, fast, easy to install and use. TgCrypto is intended for Pyrogram and implements the cryptographic algorithms Telegram requires.

Automatically installed, ignore it.

2. Fast event loop (Uvloop)

A fast, drop-in replacement of the built-in asyncio event loop. uvloop is implemented in Cython and uses libuv under the hood.

Install it, import it and call uvloop.install() in your main script.

3. Wonderful logging (Rich)

Enabled by default, but you can to disable it setting log_level parameter to logging.NOTSET.

Read more here.

4. Low latency

On hosting, choose an region close to Miami to your machine.

Installing

Pypi

python3 -m pip install pyrography

Github

python3 -m pip install git+https://github.com/d3cryptofc/pyrography

Support Official Pyrogram

If you'd like to support the official Pyrogram, you can consider:

Resources

  • Check out the docs at https://docs.pyrogram.org to learn more about Pyrogram, get started right away and discover more in-depth material for building your client applications.
  • Join the official channel at https://t.me/pyrogram and stay tuned for news, updates and announcements.

pyrography's People

Contributors

1pyxa1 avatar adolfaka avatar alissonlauffer avatar bakatrouble avatar colinshark avatar customicon avatar cyanbook avatar d3cryptofc avatar delivrance avatar furoin avatar harsh-br0 avatar jonatan1609 avatar josxa avatar kalmengr avatar krishna-singhal avatar mahesh0253 avatar mendelmaleh avatar mrnaif2018 avatar null-nick avatar octonezd avatar princic-1837592 avatar ripeey avatar shivangkakkar avatar smartmanoj avatar spechide avatar sunda001 avatar teriks avatar trenoduro avatar xsolinsx avatar yoilyl 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.