Skip to main content

nonebot-plugin-taozi-music

每天定时在 QQ 群里以语音条形式播放主播「小小桃子呦」(B站 UID 6867955)唱过的歌,支持命令点歌。随机不重复,播完一轮自动重置。

功能

  • 每日定时推送一首歌(QQ 语音条,非文件);推送前先连发 5 条「警告!!!即将开始发送今日的桃歌」
  • 只推送到开启状态的群,群列表用命令管理(加群/删群/开启/关闭)
  • 随机不重复选歌,播完一轮自动重置历史
  • 命令点歌、查看歌单、修改每日播放时间
  • 音频提前下载缓存:经 B站官方 API 只下音频流(不存视频),录播片段按时间戳裁剪(ffmpeg)

安装

nb plugin install nonebot-plugin-taozi-music
# 或
pip install nonebot-plugin-taozi-music
# 或
poetry add nonebot-plugin-taozi-music

运行环境还需安装 ffmpeg(见 https://ffmpeg.org/download.html 或 brew install ffmpeg)。音频下载走插件内置的 B站 API 流程,无需 yt-dlp。

协议端需支持语音消息(推荐 NapCat / Lagrange,会自动转码)。

配置

在 NoneBot 项目的 .env 文件中添加(均有默认值,可省略):

# 每日推送的群号初始列表(JSON 数组格式);启动时写入 data/settings.json,之后用命令管理
taozi_music_groups=["123456789"]
# 每日播放时间(初始值,可用命令修改)
taozi_music_send_time="21:00"

群设置与每日播放时间统一持久化在插件 data 目录的 settings.json 中:

{"send_time": "21:30", "groups": {"123456789": true, "987654321": false}}

使用方法

以下命令均仅 SUPERUSER 可用;群管理命令在私聊里使用时必须显式带群号:

指令 范围 说明
/桃乐 群聊/私聊 随机放一首(计入历史,不重复)
/桃乐 歌单 群聊/私聊 列出歌曲编号与歌名
/桃乐 点歌 <编号或歌名> 群聊/私聊 播放指定歌曲
/桃乐 时间 HH:MM 群聊/私聊 修改每日播放时间(持久化)
/桃乐 加群 [群号] 群聊/私聊 加入每日推送并开启;省略群号时操作当前群
/桃乐 删群 [群号] 群聊/私聊 移出每日推送
/桃乐 开启 [群号] 群聊/私聊 开启该群每日推送
/桃乐 关闭 [群号] 群聊/私聊 关闭该群每日推送
/桃乐 群列表 群聊/私聊 查看推送群及开关状态

歌单

歌单在 nonebot_plugin_taozi_music/resources/songs.yaml,每条记录:

- id: 1
  title: 歌名
  bv: BVxxxxx        # 来源视频
  start: "12:30"     # 可选:唱歌开始时间(录播片段)
  end: "14:05"       # 可选:唱歌结束时间;与 start 成对出现
  note: 来源说明

切片 UP 主切好的唱歌视频省略 start/end(整段即歌)。欢迎 PR 补充更多歌。

许可证

MIT

Metadata

Release files for nonebot-plugin-taozi-music 0.2.0

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-taozi-music 0.2.0
File Size Uploaded
nonebot_plugin_taozi_music-0.2.0.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-taozi-music 0.2.0
File Interpreter ABI Platform
nonebot_plugin_taozi_music-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.0 kB

Release files / nonebot_plugin_taozi_music-0.2.0.tar.gz

Download URL nonebot_plugin_taozi_music-0.2.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
d7f5db075655d738b40c7d6789876129d1273ecc49ad82923943eab3d234199a
BLAKE2b-256 checksum
How to use checksums
cbb28d75ab346358c6714b17ea5bed23049f877a57152e8950c9285d7b897467
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / nonebot_plugin_taozi_music-0.2.0-py3-none-any.whl

Download URL nonebot_plugin_taozi_music-0.2.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7666e1935b2106ad9ce6db1ffcbc65a98b2dfd5fac1e44d17941007e889cc8df
BLAKE2b-256 checksum
How to use checksums
a2107f8c05fd1b15e23bbd50e2a6d728ac7407ed05ee1db2b1b9338c5f6890c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release history Release notifications | RSS feed

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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