Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rahulps1000/pyropatch
An advanced monkeypatcher add-on for Pyrogram. Docs : https://rahulps1000.gitbook.io/pyropatch
https://github.com/rahulps1000/pyropatch
Last synced: 3 months ago
JSON representation
An advanced monkeypatcher add-on for Pyrogram. Docs : https://rahulps1000.gitbook.io/pyropatch
- Host: GitHub
- URL: https://github.com/rahulps1000/pyropatch
- Owner: rahulps1000
- License: gpl-3.0
- Created: 2022-06-17T12:49:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-01T13:59:26.000Z (4 months ago)
- Last Synced: 2024-07-29T09:13:27.994Z (4 months ago)
- Language: Python
- Homepage: https://pypi.org/project/pyropatch
- Size: 52.7 KB
- Stars: 33
- Watchers: 3
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Pyropatch
An advanced monkeypatcher add-on for Pyrogram
## Installation
Install pyropatch with pip
```cmd
pip install pyropatch
```
## Usage/Examples
### All patches
> * Command Handler
> * Flood Handler
> * Listen```python
from pyropatch import pyropatch #apply all patches
from pyrogram import Clientapp = Client(...)
```### Command Handler
```python
from pyropatch import command_handler #apply command handler
from pyrogram import Clientapp = Client(...)
#pass info along with commands in command filter
@app.on_message(filters.command(commands='start',info='Check Bot is Alive'))# to set bot commands from the command available on bot
app.auto_set_commands()# to get all the commands available in bot
app.commands
```
### Flood Handler
```python
from pyropatch import flood_handler #apply flood handler
from pyrogram import Clientapp = Client(...)
# all floodwaits will automatically handled
app.send_message("me", "Flood handled with **Pyropatch**!")```
### Listen
```python
from pyropatch import listen #apply listen
from pyrogram import Clientapp = Client(...)
# listen for a message in a particular chat
m = app.listen_message(chat_id=chat_id, filters=filters, timeout=timeout)# listen for a callback data in a particular message
u = app.listen_callback(chat_id=chat_id, message_id=message_id, filters=filters, timeout=timeout)
u = app.listen_callback(inline_message_id=inline_message_id, filters=filters, timout=timeout)# listen for an inline query
u = app.listen_inline_query(user_id=user_id, filters=filters, timeout=timeout)# listen for an inline result
u = app.listen_inline_result(user_id=user_id, filters=filters, timeout=timeout)
```#### More Comming Soon
##### Special thanks to [Pyromod](https://github.com/usernein/pyromod)