Modern async VK bot framework
Project description
VKFlow
Современный асинхронный фреймворк для создания ботов ВКонтакте
Установка
pip install vkflow
С дополнениями для производительности:
pip install vkflow[speed]
Быстрый старт
import vkflow as vf
app = vf.App()
@app.command("ping")
async def ping():
return "Pong!"
@app.command("дата")
async def reg_date(user: vf.User):
date = await vf.get_user_registration_date(user.id)
return f"{user:@[first_name]} зарегистрирован {date:%d.%m.%Y}"
app.run("YOUR_TOKEN")
Возможности
|
Type hints как аргументы - параметры команд парсятся из аннотаций типов |
Интерактивный UI - клавиатуры, карусели, View с callback-кнопками |
|
FSM - конечные автоматы для многошаговых диалогов |
Cog-система - группировка команд в модули |
|
Проверки и cooldown - декораторы для контроля доступа |
Webhook и LongPoll - оба режима из коробки |
|
Система аддонов - расширение функциональности через плагины | |
Интерактивные View
class ConfirmView(vf.ui.View):
def __init__(self):
super().__init__(timeout = 60, inline = True)
self.result = None
@vf.ui.button(label = "Да", color = "positive")
async def yes(self, interaction: vf.Callback):
self.result = True
await interaction.answer("Принято!")
self.stop()
@vf.ui.button(label = "Нет", color = "negative")
async def no(self, interaction: vf.Callback):
self.result = False
await interaction.answer("Отменено")
self.stop()
Cog-модули
class Admin(vf.Cog):
@vf.command("бан")
@vf.check(...)
async def ban(self, ctx: vf.Context, user: vf.User):
...
await ctx.reply(f"{user:@[first_name]} забанен")
Требования
- Python 3.11+
- VK API 5.199
Credits
Based on vkquick.
Лицензия
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vkflow-1.1.0.tar.gz.
File metadata
- Download URL: vkflow-1.1.0.tar.gz
- Upload date:
- Size: 164.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e785355a7115c3ef8ee1a76cbe5bf1e10a0ae0d7dd340776a085309c80b7c4f
|
|
| MD5 |
00875f1e9005a98d79bc589215e558c5
|
|
| BLAKE2b-256 |
5f566a1af3466d110f7e70917800dd4227bf116f9e02d39be2a3354f57f01335
|
Provenance
The following attestation bundles were made for vkflow-1.1.0.tar.gz:
Publisher:
publish.yml on rogue-meow/vkflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vkflow-1.1.0.tar.gz -
Subject digest:
8e785355a7115c3ef8ee1a76cbe5bf1e10a0ae0d7dd340776a085309c80b7c4f - Sigstore transparency entry: 1067736354
- Sigstore integration time:
-
Permalink:
rogue-meow/vkflow@000268f2df84dbb135766553cf1a28a1669f06b8 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/rogue-meow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@000268f2df84dbb135766553cf1a28a1669f06b8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vkflow-1.1.0-py3-none-any.whl.
File metadata
- Download URL: vkflow-1.1.0-py3-none-any.whl
- Upload date:
- Size: 204.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff682bd009999cdba9df70554cf40f73a64185cf14282a8315c1256dfb034b4c
|
|
| MD5 |
f429c7b1852c08cc67a42e4c073bd507
|
|
| BLAKE2b-256 |
ef2d5c1b8420b6d41c87db83c342f1c19f7470aa49cf13c306e75af11e890c9e
|
Provenance
The following attestation bundles were made for vkflow-1.1.0-py3-none-any.whl:
Publisher:
publish.yml on rogue-meow/vkflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vkflow-1.1.0-py3-none-any.whl -
Subject digest:
ff682bd009999cdba9df70554cf40f73a64185cf14282a8315c1256dfb034b4c - Sigstore transparency entry: 1067736406
- Sigstore integration time:
-
Permalink:
rogue-meow/vkflow@000268f2df84dbb135766553cf1a28a1669f06b8 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/rogue-meow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@000268f2df84dbb135766553cf1a28a1669f06b8 -
Trigger Event:
release
-
Statement type: