Simple async VK library faster than vk_api
Project description
VKBee - простая в использовании библиотека для взаимодействия с API ВКонтакте
Установка
Из PyPI:
$ pip install vkbee
Из GitHub (рекомендуется):
$ pip install https://github.com/asyncvk/vkbee/archive/master.zip
Минимальная версия Python - 3.6
Простой пример
import asyncio
import vkbee
from vkbee import oldlong
async def main(loop):
token = 'token'
vk = oldlong.VkApi(token=token, loop=loop)
longpoll = oldlong.BotLongpoll(vk, 'groupid', 10)
async for event in longpoll.events():
user_id = event['object']['message']['from_id']
message_text = event['object']['message']['text']
await vkbee.VkApi.call(vk, 'messages.send', {'user_id': user_id, 'message': message_text, 'random_id': 0})
loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))
Больше примеров имеется в документации
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
vkbee-3.9.1.tar.gz
(9.1 kB
view hashes)
Built Distribution
vkbee-3.9.1-py3-none-any.whl
(16.5 kB
view hashes)