Metadata-Version: 2.4
Name: botiksdk
Version: 0.3.1
Summary: Python SDK for Vontic Bot Platform — aiogram-style API for creating bots on Vontic
Author-email: Vondic <support@vondic.com>
License: MIT
Project-URL: Homepage, https://github.com/vondic/vondic/tree/main/botiksdk
Project-URL: Bug Tracker, https://github.com/vondic/vondic/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: AsyncIO
Classifier: Intended Audience :: Developers
Classifier: Topic :: Communications :: Chat
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.32.5
Dynamic: requires-python

# BotikSDK v0.3.0

Python SDK для создания ботов на платформе Вондик. Вдохновлён синтаксисом aiogram, но работает через API Вондик.

## Установка

```bash
pip install botiksdk>=0.3.0
```

## Быстрый старт

```python
from botiksdk import Bot, Dispatcher, Command, Message

bot = Bot(bot_id="your-bot-id", token="your-token")
dp = Dispatcher()

@dp.message(Command("start"))
async def cmd_start(message: Message, bot: Bot):
    await bot.send_message(message.chat.id, "Привет!")

import asyncio
asyncio.run(dp.start_polling(bot))
```

## Экспорты

### Типы данных
| Класс | Описание |
|---|---|
| `Bot` | Основной класс бота (отправка сообщений, файлов, модерация) |
| `Message` | Сообщение |
| `CallbackQuery` | Callback-запрос от инлайн-кнопки |
| `User` | Пользователь |
| `Chat` | Чат |
| `Update` | Обновление |
| `PublicAPIClient` | Прямой доступ к API Вондик |

### Роутинг и фильтры
| Класс | Описание |
|---|---|
| `Dispatcher` | Диспетчер (роутинг обновлений) |
| `Router` | Роутер для группировки обработчиков |
| `Command` | Фильтр по командам `/start`, `/help` |
| `Text` | Фильтр по тексту |
| `Regex` | Фильтр по регулярному выражению |
| `F` | Magic-фильтр (aiogram-style) |
| `CallbackDataFilter` | Фильтр по callback data |
| `RateLimit` | Ограничение частоты запросов |
| `FSMContext` | Контекст конечного автомата |

### Клавиатуры
| Класс | Описание |
|---|---|
| `InlineKeyboardBuilder` | Построитель инлайн-клавиатуры |
| `InlineKeyboardButton` | Инлайн-кнопка |
| `ReplyKeyboardBuilder` | Построитель reply-клавиатуры (v0.3.0) |
| `KeyboardButton` | Кнопка reply-клавиатуры (v0.3.0) |
| `ReplyKeyboardRemove` | Удаление reply-клавиатуры (v0.3.0) |

### Файлы (v0.3.0)
| Класс | Описание |
|---|---|
| `InputFile` | Обёртка для отправки файлов (локальный путь или байты → base64) |

### Игры
| Функция | Описание |
|---|---|
| `play_games_button` | Кнопка "Играть в игры" |
| `upload_game_button` | Кнопка "Загрузить игру" |
| `game_play_button` | Кнопка "Начать игру" |

## Методы Bot (v0.3.0)

### Отправка сообщений
```python
await bot.send_message(chat_id, "Текст")
await bot.send_photo(chat_id, InputFile("photo.jpg"), caption="Фото")
await bot.send_document(chat_id, InputFile("doc.pdf"))
await bot.send_voice(chat_id, InputFile("voice.ogg"))
await bot.send_video(chat_id, InputFile("video.mp4"))
await bot.send_video_note(chat_id, InputFile("circle.mp4"))
```

### Модерация
```python
await bot.ban_chat_member(chat_id, user_id)
await bot.unban_chat_member(chat_id, user_id)
await bot.kick_chat_member(chat_id, user_id)
await bot.restrict_chat_member(chat_id, user_id, permissions={"can_send_messages": False})
await bot.promote_chat_member(chat_id, user_id, can_change_info=True)
await bot.set_chat_title(chat_id, "Название")
await bot.get_chat_member(chat_id, user_id)
```

### Управление сообщениями
```python
await bot.delete_message(chat_id, message_id)
await bot.forward_message(from_chat_id, to_chat_id, message_id)
await bot.pin_chat_message(chat_id, message_id)
```

### Инлайн-действия
```python
await bot.answer_callback_query(callback.id, text="Готово!", show_alert=True)
await bot.edit_message_text("Новый текст", chat_id, message_id)
await bot.edit_message_reply_markup(chat_id, message_id, reply_markup=new_markup)
```

### Опросы
```python
poll = await bot.send_poll(chat_id, "Вопрос?", ["Да", "Нет"], is_anonymous=True)
await bot.stop_poll(chat_id, poll.message_id)
```

### Стикеры
```python
await bot.send_sticker(chat_id, sticker_id)
sticker_set = await bot.get_sticker_set("название")
```

### Бот-команды
```python
from botiksdk import Command
await bot.set_my_commands([
    {"command": "start", "description": "Начать"},
    {"command": "help", "description": "Помощь"},
])
```

### Чат-действия
```python
await bot.send_chat_action(chat_id, "typing")
```

## Reply-клавиатура (v0.3.0)

```python
from botiksdk import ReplyKeyboardBuilder, KeyboardButton

builder = ReplyKeyboardBuilder()
builder.row(
    KeyboardButton("Помощь"),
    KeyboardButton("Настройки"),
)
builder.row(
    KeyboardButton("📍 Локация", request_location=True),
)
await message.answer("Выберите действие:", reply_markup=builder.as_markup())

# Удалить клавиатуру
from botiksdk import ReplyKeyboardRemove
await message.answer("Готово!", reply_markup=ReplyKeyboardRemove().as_markup())
```

## Файлы (v0.3.0)

```python
from botiksdk import InputFile

# Из файла
photo = InputFile(path="/path/to/image.jpg")
await bot.send_photo(chat_id, photo, caption="Фото")

# Из байтов
doc = InputFile(file_bytes=b"...", filename="document.pdf")
await bot.send_document(chat_id, doc)
```

## События и хуки (v0.3.0)

```python
dp = Dispatcher()

@dp.startup
async def on_startup():
    print("Бот запущен!")

@dp.shutdown
async def on_shutdown():
    print("Бот остановлен!")

@dp.message(Command("help"))
async def help_handler(message: Message, bot: Bot):
    await message.answer("Помощь")
```

## FSM (конечные автоматы)

```python
from botiksdk import FSMContext, Command

@dp.message(Command("order"))
async def start_order(message: Message, state: FSMContext):
    await state.set_state("waiting_product")
    await message.answer("Какой товар?")

@dp.message(state="waiting_product")
async def process_order(message: Message, state: FSMContext):
    product = message.text
    await state.set_data({"product": product})
    await state.set_state("waiting_quantity")
    await message.answer("Сколько штук?")

@dp.message(state="waiting_quantity")
async def finish_order(message: Message, state: FSMContext):
    data = await state.get_data()
    await message.answer(f"Заказ: {data['product']} x {message.text}")
    await state.set_state(None)
```

## Версии

| Версия | Дата | Изменения |
|---|---|---|
| 0.1.0 | — | Первая версия. Bot, Dispatcher, Message, CallbackQuery, FSM, InlineKeyboard, фильтры |
| 0.2.0 | — | Game buttons, rate limiting |
| 0.3.0 | 2026-07-17 | Reply-клавиатуры, InputFile, модерация, опросы, стикеры, callback actions, bot commands, startup/shutdown хуки, chat actions |

## Лицензия

Внутренняя библиотека для платформы Вондик.
