Skip to main content

✨ nonebot-plugin-dancefengbot ✨

LICENSE pypi python uv ruff pre-commit

📖 介绍

为舞立方玩家提供高效便捷的数据查询服务

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-dancefengbot --upgrade

使用 pypi 源安装

nb plugin install nonebot-plugin-dancefengbot --upgrade -i "https://pypi.org/simple"

使用清华源安装

nb plugin install nonebot-plugin-dancefengbot --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
uv
uv add nonebot-plugin-dancefengbot

安装仓库 master 分支

uv add git+https://github.com/DanceFengBot/nonebot-plugin-dancefengbot@master
pdm
pdm add nonebot-plugin-dancefengbot

安装仓库 master 分支

pdm add git+https://github.com/DanceFengBot/nonebot-plugin-dancefengbot@master
poetry
poetry add nonebot-plugin-dancefengbot

安装仓库 master 分支

poetry add git+https://github.com/DanceFengBot/nonebot-plugin-dancefengbot@master

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_dancefengbot"]
使用 nbr 安装(使用 uv 管理依赖可用)

nbr 是一个基于 uv 的 nb-cli,可以方便地管理 nonebot2

nbr plugin install nonebot-plugin-dancefengbot

使用 pypi 源安装

nbr plugin install nonebot-plugin-dancefengbot -i "https://pypi.org/simple"

使用清华源安装

nbr plugin install nonebot-plugin-dancefengbot -i "https://pypi.tuna.tsinghua.edu.cn/simple"

⚙️ 配置

插件的主要配置不在 .env 中,而是在机器人运行目录下的 DcConfig/ 目录:

  • 默认路径:启动机器人时当前工作目录下的 DcConfig/;
  • 首次运行会自动创建目录、默认配置文件和 DcConfig/README.md;
  • 已经存在的文件不会被覆盖,可直接修改;
  • 可以通过环境变量 DCF_CONFIG_PATH 指定其它目录。

配置文件一览

文件 / 目录 必填 默认值 说明
ApiKeys.yml 否 空密钥 腾讯 OCR、高德地图 Key
Curfew.json 否 23:00–07:00 宵禁,延迟 3–4 秒 宵禁时段与回复延迟
OfficialMusicIds.json 否(推荐) [] 官谱 ID 列表,可用 #update all 更新
UserTokens.json 否(自动生成) {} 用户登录 Token,登录后自动写入
UserCommands.json 否 {} 预留配置
WhiteList.json / BlackList.json 否 未启用、空名单 预留名单配置
TokenIds.json 已废弃 不再生成 旧版扫码登录 client_id,可删除
Images/、Fonts/ 图片功能必填 自动下载 图片素材与字体
cache/ 否(自动生成) 空目录 图片缓存

ApiKeys.yml

用于二维码识别和「查找舞立方」机台查询,选填;不填写不影响机器人启动, 只影响对应功能。

# 腾讯 OCR SDK 密钥(二维码识别等功能需要)
tencentScannerKeys:
  secretId: ""
  secretKey: ""

# 高德地图 Web 服务 Key(「查找机台」需要)
gaodeMapKeys:
  apiKey: ""
字段 必填 默认值 说明
tencentScannerKeys.secretId 否 空 腾讯云 SecretId
tencentScannerKeys.secretKey 否 空 腾讯云 SecretKey
gaodeMapKeys.apiKey 否 空 高德地图 Web 服务 Key

Curfew.json

控制宵禁时段和每条指令开始前的随机延迟,选填;文件缺失或损坏时使用默认值。 修改后会自动重新加载,无需重启。

{
  "enabled": true,
  "ranges": [
    { "start": "23:00", "end": "07:00" }
  ],
  "delay": { "min": 3.0, "max": 4.0 },
  "admin_bypass": true
}
字段 必填 默认值 说明
enabled 否 true 是否启用宵禁与延迟
ranges 否 23:00–07:00 不回复消息的时段,支持跨天和多段;空数组表示不宵禁
delay.min 否 3.0 随机延迟下限(秒)
delay.max 否 4.0 随机延迟上限(秒),最大生效 120 秒
admin_bypass 否 true 管理员在宵禁时段是否仍可使用命令

OfficialMusicIds.json

舞立方官谱 MusicID 的 JSON 数组,默认 []。为空时所有歌曲都会被当作非官谱, 「自制」标记可能不准确。管理员可发送以下命令重新拉取:

#update official
#update all

图片与字体素材

首次运行检测到关键素材缺失时,会自动下载 DanceFengBot/dfb-miscellaneous 的 ZIP:

  1. 先尝试 GitHub 直连;
  2. 失败后依次尝试 ghfast.top、gh-proxy.com、ghproxy.net 镜像;
  3. 只解压 Fonts/、Images/,不覆盖已有文件;
  4. 素材约 80 MB,日志每 10 MB 输出一次下载进度。

全部下载源失败时,日志会输出每个源的具体错误,并生成 DcConfig/ASSETS_DOWNLOAD_FAILED.txt,其中包含手动下载步骤;机器人仍可启动, 文字功能可用,图片功能暂不可用。

如果不希望自动下载,可设置:

export DCF_SKIP_ASSETS_DOWNLOAD=1

其它文件

  • UserTokens.json:登录后自动写入,包含 accessToken / refreshToken, 属于敏感数据,请勿公开分享并定期备份;删除它等同于让用户退出登录。
  • WhiteList.json / BlackList.json / UserCommands.json:预留配置,默认不启用。
  • TokenIds.json:旧版二维码登录使用,现已废弃,不再读取或生成。

环境变量

变量 默认值 说明
DCF_CONFIG_PATH ./DcConfig 指定 DcConfig 目录
DCF_SKIP_ASSETS_DOWNLOAD 未设置 设为 1 / true 时跳过图片/字体自动下载
DANCEFENG_DEBUG 启用 设为 0 关闭插件调试输出
DANCEFENG_LOG_LEVEL DEBUG 插件控制台日志级别
DANCEFENG_LOG_DIR ./logs 日志目录;设为 0 关闭文件日志

NoneBot 配置

  • SUPERUSERS:管理员 QQ 号列表,插件管理员命令会识别该配置;
  • COMMAND_START:命令前缀,建议保留默认值。

🎉 使用

指令表

详见https://www.kdocs.cn/l/ccLRaUCuNMX0。

🎨 效果图


mydcmyrt

Metadata

Release files for nonebot-plugin-dancefengbot 2026.12.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nonebot-plugin-dancefengbot 2026.12.2.3
File Size Uploaded Provenance Actions
nonebot_plugin_dancefengbot-2026.12.2.3.tar.gz 75.9 kB Without provenance Details for nonebot_plugin_dancefengbot-2026.12.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-dancefengbot 2026.12.2.3
File Interpreter ABI Platform Actions
nonebot_plugin_dancefengbot-2026.12.2.3-py3-none-any.whl Python 3 none any Details for nonebot_plugin_dancefengbot-2026.12.2.3-py3-none-any.whl

Total release size: 185.3 kB

Release files / nonebot_plugin_dancefengbot-2026.12.2.3.tar.gz

Download URL nonebot_plugin_dancefengbot-2026.12.2.3.tar.gz
Size 75.9 kB
Tags Source
SHA-256 checksum
How to use checksums
fccfbb34d5533ac7d0a8506d1808922164d4dc1f1434a23d9ec3809e11863501
BLAKE2b-256 checksum
How to use checksums
716548fa11c0676150de793fb5a60cdd952cd56bfdadbc45a67ed8339b080f74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Release files / nonebot_plugin_dancefengbot-2026.12.2.3-py3-none-any.whl

Download URL nonebot_plugin_dancefengbot-2026.12.2.3-py3-none-any.whl
Size 109.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d73b652aeec9454367c9a8ce837d0a05e9eeae2d9bf60650665802d8b485040
BLAKE2b-256 checksum
How to use checksums
d8b1bc883d6ab4796988b58d4c2a22f7523ca6d594f00258fd69f1895f4b4e49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0

Security for nonebot-plugin-dancefengbot 2026.12.2.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page