Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashokshau/abg
ABG || Telegram bot helper || Add-on for Pyrogram || Easy Botting
https://github.com/ashokshau/abg
abg addon api bot bots easy-to-use helper hydrogram patch pykeybord pyrogram pyromod telegram telegram-bot tg tgbot
Last synced: 1 day ago
JSON representation
ABG || Telegram bot helper || Add-on for Pyrogram || Easy Botting
- Host: GitHub
- URL: https://github.com/ashokshau/abg
- Owner: AshokShau
- License: mit
- Created: 2023-06-20T14:06:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-22T14:04:17.000Z (about 1 month ago)
- Last Synced: 2024-12-26T08:12:15.051Z (10 days ago)
- Topics: abg, addon, api, bot, bots, easy-to-use, helper, hydrogram, patch, pykeybord, pyrogram, pyromod, telegram, telegram-bot, tg, tgbot
- Language: Python
- Homepage: https://t.me/GuardxSupport
- Size: 433 KB
- Stars: 14
- Watchers: 2
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
ABG### 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, Messagefrom Abg import * # type: ignore
from hydrogram.helpers import ikbapp = 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 Clientapp = 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, InlineButtonkeyboard = 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')
)
```