add-on for Pyrogram || Telegram bot helpers || Easy botting
Project description
ABG
Requirements
- Python 3.7 ᴏʀ higher.
- A ᴛᴇʟᴇɢʀᴀᴍ ᴀᴘɪ ᴋᴇʏ.
- ᴀʙɢ ᴄᴏɴғɪɢ.
Installing :
pip install -U Abg
Example
sᴇᴛᴜᴘ
from pyrogram import filters, Client
from pyrogram.types import CallbackQuery, Message
from Abg import patch # type : ignore
from Abg.helpers import ikb
app = Client("my_account")
@app.on_cmd("start")
async def start(self: Client, ctx: Message):
await self.send_msg(
chat_id=ctx.chat.id,
text=f"ok",
reply_markup=ikb([[("ʙᴜᴛᴛᴏɴ", "hello")]]),
)
# callback
@app.on_cb("hello")
async def hello(c: Client, q: CallbackQuery):
await q.answer("Hello From Abg", show_alert=True)
app.run()
ᴜsᴇʀ/ʙᴏᴛ ʀɪɢʜᴛs
from Abg import patch # all patch
from pyrogram.types import Message
from pyrogram import Client
app = Client("my_account")
@app.on_cmd("del", group_only=True)
@app.adminsOnly(permissions="can_delete_messages", is_both=True)
async def del_msg(c: Client, m: Message):
if m.reply_to_message:
await m.delete()
await c.delete_messages(
chat_id=m.chat.id,
message_ids=m.reply_to_message.id,
)
else:
await m.reply_text(text="ᴡʜᴀᴛ ᴅᴏ ʏᴏᴜ ᴡᴀɴɴᴀ ᴅᴇʟᴇᴛᴇ?")
return
app.run()
keyboard's
from Abg.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')
)
ʀᴇsᴜʟᴛ
━━━━━━━━━━━━━━━━━━━━
Configuratoins
OWNER_ID = ʏᴏᴜʀ ᴛᴇʟᴇɢʀᴀᴍ ɪᴅ.
DEV_USERS = ʙᴏᴛ ᴅᴇᴠs ɪᴅ. (ʏᴏᴜ ᴄᴀɴ ᴀᴅᴅ ᴀ ʟɪsᴛ : 1 2 3)
LOGGER_ID = ʏᴏᴜʀ ᴘʀɪᴠᴀᴛᴇ ɢʀᴏᴜᴘ/ᴄʜᴀɴɴᴇʟ ɪᴅ. (ʜᴇʀᴇ ʙᴏᴛ sᴇɴᴅ ʟᴏɢs)
━━━━━━━━━━━━━━━━━━━━
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
Abg-2.3.6.dev0.tar.gz
(24.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
Abg-2.3.6.dev0-py3-none-any.whl
(33.9 kB
view details)
File details
Details for the file Abg-2.3.6.dev0.tar.gz.
File metadata
- Download URL: Abg-2.3.6.dev0.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa1c5036d3ff9ec8148983dceab0a7df7337a8e52def1d590016e10c9d44d987
|
|
| MD5 |
80220ec70e4f50c4497f3237cffee99c
|
|
| BLAKE2b-256 |
ea0761355565e534ff90c372fff9657b30a2c58af8bee3da962b99016fda96ff
|
File details
Details for the file Abg-2.3.6.dev0-py3-none-any.whl.
File metadata
- Download URL: Abg-2.3.6.dev0-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee591ea1a5b83ee047b21984c7870c5decf02e5c7598acef52b6a83e3e0a3188
|
|
| MD5 |
8cb609657eea001a43465b4d965f47e6
|
|
| BLAKE2b-256 |
361b9140976b72bc789fc006307a561a79a4558d82e4a5d628658d8fb0d4af73
|