# 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 Client
app = Client(...)
```
### Command Handler
```python
from pyropatch import command_handler #apply command handler
from pyrogram import Client
app = 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 Client
app = 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 Client
app = 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)
Raw data
{
"_id": null,
"home_page": "https://github.com/rahulps1000/pyropatch",
"name": "pyropatch",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Rahul P S",
"author_email": "rahulps1000@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b6/6d/af53c1b9b4a25dc108366c7e4f101ca198010502a271201096e90488d9f2/pyropatch-2.1.tar.gz",
"platform": null,
"description": "\r\n# Pyropatch\r\n\r\nAn advanced monkeypatcher add-on for Pyrogram\r\n\r\n\r\n\r\n\r\n## Installation\r\n\r\nInstall pyropatch with pip\r\n\r\n```cmd\r\n pip install pyropatch\r\n```\r\n \r\n## Usage/Examples\r\n### All patches\r\n> * Command Handler\r\n> * Flood Handler\r\n> * Listen\r\n\r\n```python\r\nfrom pyropatch import pyropatch #apply all patches\r\nfrom pyrogram import Client\r\n\r\napp = Client(...)\r\n```\r\n\r\n### Command Handler\r\n```python\r\nfrom pyropatch import command_handler #apply command handler\r\nfrom pyrogram import Client\r\n\r\napp = Client(...)\r\n\r\n#pass info along with commands in command filter\r\n@app.on_message(filters.command(commands='start',info='Check Bot is Alive'))\r\n\r\n# to set bot commands from the command available on bot\r\napp.auto_set_commands()\r\n\r\n# to get all the commands available in bot\r\napp.commands\r\n```\r\n### Flood Handler\r\n```python\r\nfrom pyropatch import flood_handler #apply flood handler\r\nfrom pyrogram import Client\r\n\r\napp = Client(...)\r\n\r\n# all floodwaits will automatically handled\r\napp.send_message(\"me\", \"Flood handled with **Pyropatch**!\")\r\n\r\n```\r\n\r\n### Listen\r\n```python\r\nfrom pyropatch import listen #apply listen\r\nfrom pyrogram import Client\r\n\r\napp = Client(...)\r\n# listen for a message in a particular chat\r\nm = app.listen_message(chat_id=chat_id, filters=filters, timeout=timeout)\r\n\r\n# listen for a callback data in a particular message\r\nu = app.listen_callback(chat_id=chat_id, message_id=message_id, filters=filters, timeout=timeout)\r\nu = app.listen_callback(inline_message_id=inline_message_id, filters=filters, timout=timeout)\r\n\r\n# listen for an inline query \r\nu = app.listen_inline_query(user_id=user_id, filters=filters, timeout=timeout)\r\n\r\n# listen for an inline result \r\nu = app.listen_inline_result(user_id=user_id, filters=filters, timeout=timeout)\r\n```\r\n\r\n#### More Comming Soon\r\n\r\n##### Special thanks to [Pyromod](https://github.com/usernein/pyromod)\r\n",
"bugtrack_url": null,
"license": "LGPLv3+",
"summary": "An advanced monkeypatcher add-on for Pyrogram",
"version": "2.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "36c61dfbab4e7b5cfaebf81e5f460705c8edd33f2d1893a6935dc34a4fb4094e",
"md5": "865bf4a2a72aa8e95faad5eb3ec8b024",
"sha256": "d5929590c4b8ca2c5ae51291f76861cce1938fe1fe035da056fe5d5e611dae55"
},
"downloads": -1,
"filename": "pyropatch-2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "865bf4a2a72aa8e95faad5eb3ec8b024",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 23606,
"upload_time": "2023-03-18T18:20:36",
"upload_time_iso_8601": "2023-03-18T18:20:36.477602Z",
"url": "https://files.pythonhosted.org/packages/36/c6/1dfbab4e7b5cfaebf81e5f460705c8edd33f2d1893a6935dc34a4fb4094e/pyropatch-2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b66daf53c1b9b4a25dc108366c7e4f101ca198010502a271201096e90488d9f2",
"md5": "9ed549bec347408f55608b50e4f32ae6",
"sha256": "195355bd92b1b3c050c51da81cf9e7d6765ad3857330fe68f65e3733f2f04233"
},
"downloads": -1,
"filename": "pyropatch-2.1.tar.gz",
"has_sig": false,
"md5_digest": "9ed549bec347408f55608b50e4f32ae6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 20434,
"upload_time": "2023-03-18T18:20:38",
"upload_time_iso_8601": "2023-03-18T18:20:38.150935Z",
"url": "https://files.pythonhosted.org/packages/b6/6d/af53c1b9b4a25dc108366c7e4f101ca198010502a271201096e90488d9f2/pyropatch-2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-03-18 18:20:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "rahulps1000",
"github_project": "pyropatch",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "Pyrogram",
"specs": [
[
">=",
"2.0.16"
]
]
},
{
"name": "asyncio",
"specs": [
[
"~=",
"3.4.3"
]
]
}
],
"lcname": "pyropatch"
}