<p align="center">
<b> ABG </b>
</p>
<p align="center"><a href="https://pepy.tech/project/abg"> <img src="https://static.pepy.tech/personalized-badge/abg?period=total&units=international_system&left_color=black&right_color=black&left_text=Downloads" width="169" height="29.69" alt="Downloads"/></a></p>
### Requirements
- Python 3.8 ᴏʀ higher.
- hydrogram 0.0.1 ᴏʀ higher.
### Installing :
> **Note**: If you are using Hydrogram, avoid installing Pyrogram or its forks to prevent potential conflicts.
```bash
pip install -U Abg # For Pyrogram or Pyrogram Forks
```
```bash
pip install -U Abg[hydrogram] # For Hydrogram
```
```bash
pip install -U Abg[pyrofork] # for pyrofork
```
### Getting Started
```python
from hydrogram import Client
from hydrogram.types import CallbackQuery, Message
from Abg import * # type: ignore
from hydrogram.helpers import ikb
app = Client(
name='Abg',
api_id=6,
api_hash='eb06d4abfb49dc3eeb1aeb98ae0f581e',
bot_token="TOKEN",
in_memory=True,
)
@app.on_cmd("start")
async def start(self: Client, ctx: Message):
await ctx.reply_text("Hello World", reply_markup=ikb([[("Hello", "hello")]]))
@app.on_cb("hello")
async def hello(_: Client, q: CallbackQuery):
await q.answer("Hello From Abg", show_alert=True)
app.run()
```
#### Permissions Check for Admins
```python
from Abg import * # type: ignore # (all patch)
from hydrogram.types import Message
from hydrogram import Client
app = Client("my_account")
@app.on_cmd("del", group_only=True)
@adminsOnly(
self=app,
permissions="can_delete_messages",
is_both=True,
) # also you can use like this @app.adminsOnly(permissions="can_delete_messages", is_both=True)
async def del_msg(self: Client, m: Message):
if m.reply_to_message:
await m.delete()
await self.delete_messages(
chat_id=m.chat.id,
message_ids=m.reply_to_message.id,
)
else:
await m.reply_text(text="Reply to a message to delete it")
app.run()
```
>
#### keyboard's
```python
from Abg.patch.inline import InlineKeyboard, InlineButton
keyboard = InlineKeyboard(row_width=3)
keyboard.add(
InlineButton('1', 'inline_keyboard:1'),
InlineButton('2', 'inline_keyboard:2'),
InlineButton('3', 'inline_keyboard:3'),
InlineButton('4', 'inline_keyboard:4'),
InlineButton('5', 'inline_keyboard:5'),
InlineButton('6', 'inline_keyboard:6'),
InlineButton('7', 'inline_keyboard:7')
)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/AshokShau/Abg",
"name": "Abg",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "add-on bots telegram bot hydrogram pyrogram",
"author": "AshokShau (Ashok)",
"author_email": "<abishnoi69@outlook.com>",
"download_url": "https://files.pythonhosted.org/packages/86/42/3b612dec0717416ed45392025bd03cd2742ba18d9d758fcdd4f5e4ae9fac/abg-2.5.3.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n<b> ABG </b>\n</p>\n\n<p align=\"center\"><a href=\"https://pepy.tech/project/abg\"> <img src=\"https://static.pepy.tech/personalized-badge/abg?period=total&units=international_system&left_color=black&right_color=black&left_text=Downloads\" width=\"169\" height=\"29.69\" alt=\"Downloads\"/></a></p>\n\n### Requirements \n\n- Python 3.8 \u1d0f\u0280 higher.\n- hydrogram 0.0.1 \u1d0f\u0280 higher.\n\n### Installing :\n> **Note**: If you are using Hydrogram, avoid installing Pyrogram or its forks to prevent potential conflicts.\n\n```bash\npip install -U Abg # For Pyrogram or Pyrogram Forks\n```\n\n```bash\npip install -U Abg[hydrogram] # For Hydrogram\n```\n```bash\npip install -U Abg[pyrofork] # for pyrofork\n```\n\n\n### Getting Started\n```python\nfrom hydrogram import Client\nfrom hydrogram.types import CallbackQuery, Message\n\nfrom Abg import * # type: ignore\nfrom hydrogram.helpers import ikb\n\napp = Client(\n name='Abg',\n api_id=6,\n api_hash='eb06d4abfb49dc3eeb1aeb98ae0f581e',\n bot_token=\"TOKEN\",\n in_memory=True,\n)\n\n\n@app.on_cmd(\"start\")\nasync def start(self: Client, ctx: Message):\n await ctx.reply_text(\"Hello World\", reply_markup=ikb([[(\"Hello\", \"hello\")]]))\n\n\n@app.on_cb(\"hello\")\nasync def hello(_: Client, q: CallbackQuery):\n await q.answer(\"Hello From Abg\", show_alert=True)\n\n\napp.run()\n\n```\n\n#### Permissions Check for Admins\n```python\nfrom Abg import * # type: ignore # (all patch)\nfrom hydrogram.types import Message\nfrom hydrogram import Client\n\napp = Client(\"my_account\")\n\n@app.on_cmd(\"del\", group_only=True)\n@adminsOnly(\n self=app,\n permissions=\"can_delete_messages\",\n is_both=True,\n) # also you can use like this @app.adminsOnly(permissions=\"can_delete_messages\", is_both=True)\nasync def del_msg(self: Client, m: Message):\n if m.reply_to_message:\n await m.delete()\n await self.delete_messages(\n chat_id=m.chat.id,\n message_ids=m.reply_to_message.id,\n )\n else:\n await m.reply_text(text=\"Reply to a message to delete it\")\n \napp.run()\n```\n\n\n>\n#### keyboard's\n\n```python\nfrom Abg.patch.inline import InlineKeyboard, InlineButton\n\nkeyboard = InlineKeyboard(row_width=3)\nkeyboard.add(\n InlineButton('1', 'inline_keyboard:1'),\n InlineButton('2', 'inline_keyboard:2'),\n InlineButton('3', 'inline_keyboard:3'),\n InlineButton('4', 'inline_keyboard:4'),\n InlineButton('5', 'inline_keyboard:5'),\n InlineButton('6', 'inline_keyboard:6'),\n InlineButton('7', 'inline_keyboard:7')\n)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "add-on for Pyrogram || add-on for Hydrogram || Telegram bot helpers || Easy botting",
"version": "2.5.3",
"project_urls": {
"Community": "https://t.me/Abgpy",
"Documentation": "https://abg.abishnoi.me/",
"Download": "https://github.com/AshokShau/Abg/releases/latest",
"Homepage": "https://github.com/AshokShau/Abg",
"Source": "https://github.com/AshokShau/Abg",
"Tracker": "https://github.com/AshokShau/Abg/issues"
},
"split_keywords": [
"add-on",
"bots",
"telegram",
"bot",
"hydrogram",
"pyrogram"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "86423b612dec0717416ed45392025bd03cd2742ba18d9d758fcdd4f5e4ae9fac",
"md5": "1d0e7f5d18a539a265cfd4142ff1835b",
"sha256": "2ae11bb66533fca225c5690cbcc2078bc027227030d1d27dc740cee186c0f542"
},
"downloads": -1,
"filename": "abg-2.5.3.tar.gz",
"has_sig": false,
"md5_digest": "1d0e7f5d18a539a265cfd4142ff1835b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 41391,
"upload_time": "2024-11-22T13:31:40",
"upload_time_iso_8601": "2024-11-22T13:31:40.444328Z",
"url": "https://files.pythonhosted.org/packages/86/42/3b612dec0717416ed45392025bd03cd2742ba18d9d758fcdd4f5e4ae9fac/abg-2.5.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-22 13:31:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AshokShau",
"github_project": "Abg",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "abg"
}