Skip to main content

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


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.2.tar.gz (26.6 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.4.2-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for botiksdk-0.4.2.tar.gz
Algorithm Hash digest
SHA256 afa32801c0e2ef31f63713e5e83c5f91d3f28012c9d750f9c8b811a6bcc30676
MD5 a6bac69512859497f5b4853dac3b1120
BLAKE2b-256 bf055a8eebb8937534425e34d6f356b7df8cb9120ae8ec0c16bd8e2e7606a0cc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: botiksdk-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 27.0 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.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4e398ff81550e29c302531fa1e902cf1095ae693fed9a29f1f13136ce9bb14f8
MD5 93a95a0b0182357fce974bc77052e1d5
BLAKE2b-256 cdd38095644b7a92992d3743bef81105ec6fe0d9bee9138f3fc77b92d8ff8a1d

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