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,会自动转码)。语音以 base64 内联发送,协议端(NapCat/Lagrange 等)可以与 bot 不在同一台机器,无需共享文件系统。

配置

在 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.2

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.2
File Size Uploaded
nonebot_plugin_taozi_music-0.2.2.tar.gz 13.1 kB Details

Built distribution (wheel)

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

Total release size: 29.4 kB

Release files / nonebot_plugin_taozi_music-0.2.2.tar.gz

Download URL nonebot_plugin_taozi_music-0.2.2.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8b8b9aad897a444233aeef30f35acb0feb702a5ca2be4b89e19316ea31efb6d6
BLAKE2b-256 checksum
How to use checksums
9c65d18627e8a003046db24c10ff4478b4f5748ad38bbd3cab6cdfad9fac5ce8
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.2-py3-none-any.whl

Download URL nonebot_plugin_taozi_music-0.2.2-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
167d0fab5f32e494a3992a3167a144bad1bff0ea08ee0b6e85b244f13e3349f8
BLAKE2b-256 checksum
How to use checksums
6881853ce386451dc8302dfef13be096a2b6367046ccac76c6418fd8a8c2b1ac
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

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

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