vktools

Инструменты для модуля vk-api. Клавиатура и карусели.


Keywords
vktools, vk, vk-api, api, python
Install
pip install vktools==1.0.8

Documentation

VkTools - дополнительные инструменты для vk-api

Инструменты 🛠

Python Json typing

Установка 💾

  • Установка, используя пакетный менеджер pip
$ pip install vktools
  • Установка с GitHub (требуется git)
$ git clone https://github.com/Fsoky/vktools
$ cd vktools
$ python setup.py install
  • Или
$ pip install git+https://github.com/Fsoky/vktools

Клавиатура

from vktools import Keyboard, ButtonColor, Text, OpenLink, Location

keyboard = Keyboard(
    [
        [
            Text("RED", ButtonColor.NEGATIVE),
            Text("GREEN", ButtonColor.POSITIVE),
            Text("BLUE", ButtonColor.PRIMARY),
            Text("WHITE")
        ],
        [
            OpenLink("YouTube", "https://youtube.com/c/Фсоки"),
            Location()
        ]
    ]
)

.add_keyboard() - получить JSON клавиатуры
.get_empty_keyboard() - Удалить клавиатуру

Keyboard

Карусель

from vktools import Keyboard, ButtonColor, Text, Carousel, Element

carousel = Carousel(
    [
        Element(
            "The First Title",
            "The First Description",
            "-000000_1111111", # ID фотографии
            "https://vk.com/fsoky", # Редирект при клике
            [Text("Button 1", ButtonColor.POSITIVE)]
        ),
        Element(
            "The Second Title",
            "The Second Description",
            "-000000_1111111",
            "https://vk.com/fsoky",
            [Text("Button 2", ButtonColor.NEGATIVE)]
        )     
    ]
)

.add_carousel() - Получить JSON карусели

Carousel

Присоединяйся к нам

Vkontakte YouTube Telegram