Skip to main content

ᴀʙɢ :->

• Abg

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("myinfo")
async def my_info(self: Client, ctx: Message):
    if not ctx.from_user:
        return
    name = await ctx.chat.ask("Type Your Name")
    age = await ctx.chat.ask("Type your age")
    add = await ctx.chat.ask("Type your address")
    # you can also use : ctx.reply_text(...)
    await self.send_msg(
        chat_id=ctx.chat.id,
        text=f"Your name is: {name.text}\nYour age is: {age.text}\nyour address is: {add.text}",
        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()

• User Rights

from Abg import patch  # type : ignore
from Abg.chat_status import adminsOnly
from pyrogram.types import Message
from pyrogram import Client

app = Client("my_account")

@app.on_cmd("del", group_only=True)
@adminsOnly("can_delete_messages")
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()

• Keyboards

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')
)

Result

add_inline_button

ɪɴsᴛᴀʟʟɪɴɢ :->

pip install -U Abg

━━━━━━━━━━━━━━━━━━━━

ɴᴏᴛᴇ :->

  • This library is made for my personal Project so don't take it deeply .

  • My Project @GuardxRobot

  • ᴇɴᴊᴏʏ ʙᴀʙʏ ♡

━━━━━━━━━━━━━━━━━━━━

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.1.tar.gz (25.3 kB view details)

Uploaded Source

File details

Details for the file Abg-2.3.1.tar.gz.

File metadata

  • Download URL: Abg-2.3.1.tar.gz
  • Upload date:
  • Size: 25.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for Abg-2.3.1.tar.gz
Algorithm Hash digest
SHA256 2e48e86041b26e67acd783696391de72c41ea1ce76b113cbd7d15bc09b982c7c
MD5 3156bb3c42b4c2298b1bdf37985db3df
BLAKE2b-256 2b20d63fac92af3b5c4d133d3a7ffa898e607122e3dc3eeb3dd495d592d8cd80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page