✨ nonebot-plugin-dancefengbot ✨
📖 介绍
为舞立方玩家提供高效便捷的数据查询服务
💿 安装
使用 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 |
否 | {} |
预留配置 |
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:
- 先尝试 GitHub 直连;
- 失败后依次尝试
ghfast.top、gh-proxy.com、ghproxy.net镜像; - 只解压
Fonts/、Images/,不覆盖已有文件; - 素材约 80 MB,日志每 10 MB 输出一次下载进度。
全部下载源失败时,日志会输出每个源的具体错误,并生成
DcConfig/ASSETS_DOWNLOAD_FAILED.txt,其中包含手动下载步骤;机器人仍可启动,
文字功能可用,图片功能暂不可用。
如果不希望自动下载,可设置:
export DCF_SKIP_ASSETS_DOWNLOAD=1
其它文件
UserTokens.json:登录后自动写入,包含accessToken/refreshToken, 属于敏感数据,请勿公开分享并定期备份;删除它等同于让用户退出登录。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。
🎨 效果图
Metadata
Release files for nonebot-plugin-dancefengbot 2026.12.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_dancefengbot-2026.12.2.4.tar.gz | 75.8 kB | Without provenance | Details for nonebot_plugin_dancefengbot-2026.12.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_dancefengbot-2026.12.2.4-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_dancefengbot-2026.12.2.4-py3-none-any.whl |
Total release size: 185.0 kB
Release files / nonebot_plugin_dancefengbot-2026.12.2.4.tar.gz
| Download URL | nonebot_plugin_dancefengbot-2026.12.2.4.tar.gz |
|---|---|
| Size | 75.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b1aeb59d46b137aaf43266b82582e384dee30b68d18c26a1cdadfe733641f42
|
|
BLAKE2b-256 checksum How to use checksums |
4a0b7b1b5447c4c30d8e1825e0327f1874bda5b9ae93a72cee04d59b7328c3d0
|
| 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.4-py3-none-any.whl
| Download URL | nonebot_plugin_dancefengbot-2026.12.2.4-py3-none-any.whl |
|---|---|
| Size | 109.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46786d2ba3d6808ab5d304ef3e97fc2f21ada97f2a7826e9936b3ab2efb20de0
|
|
BLAKE2b-256 checksum How to use checksums |
9923bea84ccacc0f4da312a174fb73edf1e51066b643aa071be8fd0487cd3e6a
|
| 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.4
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.