Skip to main content

Фреймворк на Python для VK API

Project description

Фреймворк для VK API.

С помощью этого фреймворка можно написать бота для группы ВКонтакте. Фреймворк был сделан недавно, документация появится чуть позже.

Фреймворк устанавливается с помощью команды

pip install vk_air

или

pip install git+https://github.com/sultan1k/vk_air

Пару примеров с кодом:

from vk_air import Client
from vk_air.utils import Utils

bot = Client(prefix='!', debug=False)

@bot.command(name='hi')
async def hi(ctx):
  await ctx.send('Привет')

@bot.event(name='chat_invite_user')
async def add_me(ctx):
  if ctx.action.member_id == -bot.group.id:
    await ctx.send('Вы добавили меня в беседу!')

@bot.command(name='whois')
async def whois(ctx, user, *, reason):
  user = Utils().mention_to_id(user) # достаём из упоминания айди
  await ctx.send(f'Айди пользователя - {user}\nПричина вызова команды: {reason}')

bot.login(token='TOKEN')

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

vk_air-0.5.17.tar.gz (41.9 kB view hashes)

Uploaded Source

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