Python SDK for Vontic Bot Platform — full aiogram-style API with consent permissions
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.0.tar.gz
(23.3 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.0-py3-none-any.whl
(23.8 kB
view details)
File details
Details for the file botiksdk-0.4.0.tar.gz.
File metadata
- Download URL: botiksdk-0.4.0.tar.gz
- Upload date:
- Size: 23.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13376052e6f22ecefeaa792d9378902740e134392faea92b609c7da27d46b462
|
|
| MD5 |
25831fc76113127675ed356f21bdc235
|
|
| BLAKE2b-256 |
d822307f43c8a654e7562019f795314ae4d555475551a3615346a73ce33d02c1
|
File details
Details for the file botiksdk-0.4.0-py3-none-any.whl.
File metadata
- Download URL: botiksdk-0.4.0-py3-none-any.whl
- Upload date:
- Size: 23.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 |
37b3935811d0dd6d4eb1dff2f6ac0433e1eccd016cc309a20b64ae0c8791bc6b
|
|
| MD5 |
a2c65dfb7b55a3b56cbb6528ded3fd2f
|
|
| BLAKE2b-256 |
137df2c30c67f83768d02b9f0e13b7d4b8e38d2c46da0a7b622961d17c5a7dde
|