Skip to main content

万物皆可 API / SDK 的机器人框架

Project description

Butter-Bot

一个基于 Python 3.12+ 和 asyncio 的事件驱动机器人框架。项目把外部输入抽象为 Source,把数据与状态包装为 Event,再由 EventBus 分发给异步 Handler。

当前仓库内置:

  • NapCat OneBot WebSocket 事件与 API;
  • Bilibili 动态轮询、直播状态轮询和直播弹幕事件源;
  • Source、API、Data、Type 和 Filter 扩展契约;
  • 统一启动、回调排空与资源关闭流程。

安装与开发

uv sync --locked --dev

运行完整 Python 检查:

uv run pytest
uv run ruff check .
uv run ruff format --check .
uv run pyright

最小示例

不依赖外部服务的示例:

uv run examples/minimal_source_example.py

预期输出 ready 并正常退出。NapCat 与 Bilibili 示例需要先复制并填写本地配置:

cp examples/config.example.yaml config.yaml

config.yaml 可能包含凭证,已被 Git 忽略,不要提交或公开。

文档

本地启动 VuePress 2 + Plume 文档站:

npm install
npm run docs:dev

推荐入口:

生产构建与文档检查:

npm ci
npm run docs:build
npm run docs:lint
npm run docs:links

许可证

GPL-3.0

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

butterbot_python-3.1.0.dev1.tar.gz (343.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

butterbot_python-3.1.0.dev1-py3-none-any.whl (129.0 kB view details)

Uploaded Python 3

File details

Details for the file butterbot_python-3.1.0.dev1.tar.gz.

File metadata

  • Download URL: butterbot_python-3.1.0.dev1.tar.gz
  • Upload date:
  • Size: 343.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for butterbot_python-3.1.0.dev1.tar.gz
Algorithm Hash digest
SHA256 9f4daaebe8b74bb4ce9b86a88af410183725c88dea11dbfbe6a6631ebbc8916e
MD5 be72e8018b41568c81fb6e3cf562348e
BLAKE2b-256 5024af23c43e1616653db123ace54c4aa4518b47dd8c1243f29f96776ddb227f

See more details on using hashes here.

Provenance

The following attestation bundles were made for butterbot_python-3.1.0.dev1.tar.gz:

Publisher: release-on-version.yml on GEYUANwuqi/Butter-Bot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file butterbot_python-3.1.0.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for butterbot_python-3.1.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 59b4ab90f456921507781bab24cc4ed6006ea938efdb82efbf60279e2de204cf
MD5 0c1d5679de4f14a5c03d2d82440e3ea5
BLAKE2b-256 b44e39cdfeace22f017b85a7973e35afdf4b52db6a3b90f7eae7750846a843f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for butterbot_python-3.1.0.dev1-py3-none-any.whl:

Publisher: release-on-version.yml on GEYUANwuqi/Butter-Bot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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