Metadata-Version: 2.4
Name: python-rubika-bot
Version: 0.2.4
Summary: A production-ready, enterprise-grade Python SDK for the Rubika Bot API
Author-email: Developer <developer@example.com>
License: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0.0
Requires-Dist: httpx>=0.24.0
Requires-Dist: requests>=2.31.0
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn>=0.23.0
Requires-Dist: typing_extensions>=4.0.0
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: black; extra == "dev"
Dynamic: license-file

# python-rubika-bot

A production-ready, enterprise-grade Python SDK for the Rubika Bot API.

## Features

- **Entity-Oriented API**: Work directly with `Message`, `Chat`, and `User` objects! `await chat.send(...)`, `await user.ban()`, `await message.reply()`.
- **Rich Typed Objects**: API calls seamlessly return properly structured, explicitly typed Pydantic models. Say goodbye to raw dictionaries!
- **Strictly Typed API Signatures**: Zero `**kwargs`. The entire SDK uses 100% explicit typing for crystal clear auto-completion and static analysis. 
- **Zero Logic Duplication**: All convenience methods map strictly to their single-source-of-truth `Bot` core methods.
- **Fluent API**: Edit or interact with entities in a chainable manner (`await message.edit("New").delete()`).
- **Powerful Composable Filters**: Extensive suite of Pyrogram-like combinable filters (`filters.text & filters.private & ~filters.command`).
- **Dependency Injection**: Seamlessly inject `Message`, `Bot`, `Context`, `User`, `Chat`, or `FSMContext` directly via Type Hints into any handler.
- **Scheduler**: Run recurring functions using `.every(minutes=5)`, `.cron(...)`, or `.once()`.
- **Lifecycle & Error Hooks**: Register logic using `@bot.on_startup()`, `@bot.on_shutdown()`, and `@bot.on_error()`.
- **Plugin Architecture**: Load external `.py` modules dynamically using `bot.load_plugin()`.
- **Developer CLI**: Run `python-rubika-bot new my_bot` to instantly bootstrap your project.
- **Testing Utilities**: First-class support for `FakeBot`, `FakeMessage`, and `TestClient` for unit testing handlers.

## Installation

```bash
pip install python-rubika-bot
```

## Quick Start

```python
from python_rubika_bot import Bot, filters

bot = Bot(token="YOUR_BOT_TOKEN_HERE")

@bot.command("start")
async def start_handler(message):
    # Native explicit Entity API
    await message.reply("Hello from python-rubika-bot SDK!")

@bot.on_message(filters.text & filters.private)
async def text_handler(message):
    # Edit the message inline
    sent_msg = await message.reply("Thinking...")
    await sent_msg.edit(f"You said: {message.text}")

if __name__ == "__main__":
    bot.run()
```

## Advanced Features 

### Context, DI & Hooks

```python
from python_rubika_bot import Bot, filters
from python_rubika_bot.utils import Context

bot = Bot(token="TOKEN")

@bot.on_startup()
async def db_setup(bot: Bot):
    print("Bot is starting up!")

@bot.before_request()
async def before(req):
    pass

@bot.on_message(filters.text)
async def injected_handler(message, chat, user, context: Context):
    context.data["visited"] = True
    await chat.send_message(f"Hello {user.name}")
```

### Scheduling

```python
async def ping():
    print("Pong!")

bot.scheduler.every(minutes=5).do(ping)
bot.scheduler.cron("0 12 * * *").do(ping)
```

## Developer CLI
Bootstrap a bot automatically with:
```bash
python-rubika-bot new mybot
```

## License
MIT License
