Metadata-Version: 2.2
Name: TgBee
Version: 1.0.9
Summary: An asynchronous Python Telegram Bot API wrapper
Home-page: https://github.com/x7007x/TgBee
Author: Ahmed Negm
Author-email: a7mednegm.x@gmail.com
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.7.4
Requires-Dist: aiofiles
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# TgBee

TgBee is an asynchronous Python wrapper for the Telegram Bot API. It provides a simple and intuitive interface for creating Telegram bots using modern Python features.

## Features

- Asynchronous API calls using `aiohttp`
- Easy-to-use decorator-based handler system
- Support for inline keyboards and callback queries
- Plugin system for modular bot development
- FastAPI integration for webhook support

## Installation

You can install TgBee using pip: 
```bash
pip3 install -U TgBee
```

## Example

```python
import asyncio
from TgBee import Client, filters

bot = Client(token="YOUR_BOT_TOKEN")

@bot.on_message(filters.command("start"))
async def start_command(client, message):
    reply_markup = {
        "inline_keyboard": [
            [
                {"text": "Button 1", "callback_data": "button1"},
                {"text": "Button 2", "callback_data": "button2"}
            ]
        ]
    }

    mention = message.from_user.mention
    sent_message = await client.send_message(
        chat_id=message.chat.id,
        text=f"Welcome {mention} to the bot! Here's a message with some buttons:",
        parse_mode="HTML",
        reply_markup=reply_markup
    )

@bot.on_callback_query()
async def handle_callback(client, callback_query):
    callback_query_id = callback_query.id
    data = callback_query.data

    if data == "button1":
        await client.answer_callback_query(callback_query_id=callback_query_id, text="You pressed Button 1!", show_alert=True)
    elif data == "button2":
        await client.answer_callback_query(callback_query_id=callback_query_id, text="You pressed Button 2!", show_alert=True)
    else:
        await client.answer_callback_query(callback_query_id=callback_query_id, text="Unknown button pressed", show_alert=True)

async def main():
    await bot.run()

if __name__ == "__main__":
    asyncio.run(main())
```
