Python SDK for Vontic Bot Platform — full aiogram-style API with consent permissions and full message type support
Project description
BotikSDK v0.3.0
Python SDK для создания ботов на платформе Вондик. Вдохновлён синтаксисом aiogram, но работает через API Вондик.
Установка
pip install botiksdk>=0.3.0
Быстрый старт
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)
Отправка сообщений
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"))
Модерация
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)
Управление сообщениями
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)
Инлайн-действия
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)
Опросы
poll = await bot.send_poll(chat_id, "Вопрос?", ["Да", "Нет"], is_anonymous=True)
await bot.stop_poll(chat_id, poll.message_id)
Стикеры
await bot.send_sticker(chat_id, sticker_id)
sticker_set = await bot.get_sticker_set("название")
Бот-команды
from botiksdk import Command
await bot.set_my_commands([
{"command": "start", "description": "Начать"},
{"command": "help", "description": "Помощь"},
])
Чат-действия
await bot.send_chat_action(chat_id, "typing")
Reply-клавиатура (v0.3.0)
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)
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)
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 (конечные автоматы)
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 |
Лицензия
Внутренняя библиотека для платформы Вондик.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
botiksdk-0.4.1.tar.gz
(26.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
botiksdk-0.4.1-py3-none-any.whl
(26.8 kB
view details)
File details
Details for the file botiksdk-0.4.1.tar.gz.
File metadata
- Download URL: botiksdk-0.4.1.tar.gz
- Upload date:
- Size: 26.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3b789341a17a780fb21a021fde7d8c03c4bd9e0a12389d9e5b84196cf78fbea
|
|
| MD5 |
1549bf1545f27ab03d83593a4f8cbff4
|
|
| BLAKE2b-256 |
73bb9d38ce8708e04d3cf345a719b03cc681d79c8138e1ed84b0e1551e4a9ef5
|
File details
Details for the file botiksdk-0.4.1-py3-none-any.whl.
File metadata
- Download URL: botiksdk-0.4.1-py3-none-any.whl
- Upload date:
- Size: 26.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb162e420d20f478ffc3e2a3049fff13abb7d3a19c879445e17ce1b67c19f880
|
|
| MD5 |
1689d6f82e74fc37d4f3bff5501b38d3
|
|
| BLAKE2b-256 |
7a710be2ad120e66eb02fdbe3e0d8baf051bb8cd5936aad54a4e731922c956fc
|