Skip to main content

ABG

Downloads

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.

pip install -U Abg # For Pyrogram or Pyrogram Forks
pip install -U Abg[hydrogram] # For Hydrogram

Getting Started

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

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

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

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

Uploaded Source

File details

Details for the file abg-2.3.9.tar.gz.

File metadata

  • Download URL: abg-2.3.9.tar.gz
  • Upload date:
  • Size: 40.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for abg-2.3.9.tar.gz
Algorithm Hash digest
SHA256 9dffa7b953aeeb5c6e5738e86174e5fa7d887ed7ab839302bcd6f1d74fc74830
MD5 3aa65e492ac745e97de27ba37bdd9836
BLAKE2b-256 bef5d4e34ba9d59ee7f2da9bcfc9b801309beed4ae02475a85c7ab32e4ec4b7d

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