Metadata-Version: 2.4
Name: karboai
Version: 1.0.8
Summary: Python library for https://karboai.com
Home-page: https://github.com/yourusername/karboai-python
License: MIT
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.9
Requires-Dist: python-socketio>=5.10
Requires-Dist: pydantic>=2.0
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# KarboAI

Python library for [KarboAI](https://karboai.com) bot development.

## Install

```bash
pip install karboai
```

## Usage

```python
import asyncio
from karboai import KarboAI, Router, bold

karbo = KarboAI(token="your-token", id="your-bot-id", enable_logging=True)
router = Router()

@router.command("/start")
async def start(ctx):
    await karbo.text(ctx.message.chat_id, bold("Welcome!"))

@router.on("message")
async def echo(ctx):
    await karbo.text(ctx.message.chat_id, ctx.message.content)

async def main():
    karbo.bind(router)
    await karbo.attach()

asyncio.run(main())
```

## API

| Method | Description |
|--------|-------------|
| `me()` | Bot info |
| `text(chat_id, content, reply_message_id?)` | Send text |
| `image(chat_id, images, reply_message_id?)` | Send images |
| `upload(buffer, file_name?)` | Upload image, returns URL |
| `message(chat_id, message_id)` | Get message |
| `members(chat_id, limit?, offset?)` | Chat members |
| `user(user_id)` | User info |
| `leave(chat_id)` | Leave chat |
| `kick(chat_id, user_id)` | Kick user |
| `attach(callback?)` | Connect to WebSocket |
| `bind(*routers)` | Bind routers |

## Events

`message`, `join`, `leave`, `voiceStart`, `voiceEnd`, `sticker`

## Text formatting

`bold()`, `italic()`, `centralize()`, `code()`, `strikethrough()`, `underline()`, `hyperlink(text, url)`

## Error handling

```python
from karboai import KarboError

try:
    await karbo.me()
except KarboError as e:
    print(e.status_code, e.name, e)
```
