Skip to main content

Python SDK for Vontic Bot Platform — aiogram-style API for creating bots on Vontic

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


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.3.0.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

botiksdk-0.3.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file botiksdk-0.3.0.tar.gz.

File metadata

  • Download URL: botiksdk-0.3.0.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for botiksdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 27cb5fb720a9176a24efdcb8a13e47b71c5ce4856029b49c000475037567c0da
MD5 a77f5a9106643877835c24c603ba3dda
BLAKE2b-256 08ae81408a2fe1d38cbf538434547aba3ddee10bbd9fd3ed383e13aba967603c

See more details on using hashes here.

File details

Details for the file botiksdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: botiksdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.13

File hashes

Hashes for botiksdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d98952e00fa904b8e1b0887dbae6e62d6ca6badc904e9109b90b170fd5486bb1
MD5 26edcbf23e72f03d655a670f40b7e3c2
BLAKE2b-256 316f6ee00b6b2e491112066d9fcf8b715178b01a6e2a7dfd447d8adbc561f578

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page