A monkeypatched add-on for Pyrogram
Project description
pyromod
A monkeypatched add-on for Pyrogram
Introduction
pyromod is a compilation of utils i developed for extend my personal use of Pyrogram. Then i started to use it and more bots and now i published it to make it easier to be installed in new projects. It works together with pyrogram, this is not a fork nor modded version. It does monkey patching to add features to Pyrogram classes. Note: it uses pyrogram asyncio.
Usage
I separated the utils in packages, you should import them to do the monkeypatch (except for pyromod.utils
with provides classes and functions to be explicitely imported):
pyromod.listen
Just import it and you have these new methods:
-
await pyrogram.Client.listen(chat_id, timeout=30)
Awaits for a new message in the specified chat and returns it -
await pyrogram.Client.ask(text, chat_id, timeout=30)
Same of.listen()
above, but sends a message before awaiting -
The bound methods
Chat.listen
,User.listen
,Chat.ask
andUser.ask
Usage:
from pyromod import listen # or import pyromod.listen
from pyrogram import Client
client = Client(...)
...
answer = await client.ask('Confirm? [Yn]', chat_id)
Copyright & License
This project may include snippets of Pyrogram code
- Pyrogram - Telegram MTProto API Client Library for Python
- Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
- Licensed under the terms of the GNU Lesser General Public License v3 or later (LGPLv3+)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyromod-0.0.1.tar.gz
.
File metadata
- Download URL: pyromod-0.0.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ce61a20d230882302abfba98ad6e6c72b60aed022c345bee93904121a662447 |
|
MD5 | 83f0908de6c6ff8d9bade3af9cf6bb8f |
|
BLAKE2b-256 | 6e5c9c0da83b4f4aafef97c9082543701890d34aca4ec492a325c5ea5cb17439 |
File details
Details for the file pyromod-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: pyromod-0.0.1-py3-none-any.whl
- Upload date:
- Size: 19.6 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/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ab3d9dd050fa742278b1fad3999a19d128696675830a7074f417920fca05922 |
|
MD5 | f442f16a88eedab09d149b71114be2c4 |
|
BLAKE2b-256 | 98e7751f63b84f98e811cffbf7623504ab9af93b58e733f93752de115c9931b0 |