Skip to main content

Simple async VK library faster than vk_api

Project description

vkbee

VKBee - простая в использовании библиотека для взаимодействия с API ВКонтакте

Made with Python Downloads

Установка

Из 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


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)

Uploaded Source

Built Distribution

vkbee-3.9.1-py3-none-any.whl (16.5 kB view hashes)

Uploaded Python 3

Supported by

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