NoneBot2 plugin for Bilibili live group subscriptions powered by nonebot-adapter-bilibili-live.
Project description
nonebot-plugin-bilibili-live-notify
基于 nonebot-adapter-bilibili-live 的 NoneBot2 插件,专注于 QQ 群内的 B 站直播订阅管理:
- 群管理员订阅直播间
- 群成员自行加入或退出提醒名单
- 开播 / 下播自动推送
- 按参与成员进行
@提醒 - 本地持久化订阅状态
直接消费 nonebot-adapter-bilibili-live 提供的直播事件。
前置要求
- NoneBot2
>= 2.4.2 nonebot-adapter-onebotnonebot-adapter-bilibili-live
推荐使用 bilibili-live 适配器的 Web Bot 模式,因为可以直接按房间号监听。
安装
使用 nb 安装:
nb plugin install nonebot-plugin-bilibili-live-notify
或使用 pip 安装:
pip install nonebot-plugin-bilibili-live-notify
然后在 NoneBot 中加载插件:
[tool.nonebot]
plugins = ["nonebot_plugin_bilibili_live_notify"]
配置
插件自身只需要一个可选配置项:
BILIBILI_LIVE_NOTIFY_DATA_FILE=.data/nonebot_plugin_bilibili_live_notify/subscriptions.json
BILIBILI_LIVE_NOTIFY_MANAGED_ROOMS_FILE=.data/nonebot_plugin_bilibili_live_notify/managed_rooms.json
BILIBILI_LIVE_NOTIFY_EXPORT_FILE=.data/nonebot_plugin_bilibili_live_notify/generated_bilibili_live_bots.json
BILIBILI_LIVE_NOTIFY_DATA_FILE: 自定义订阅数据文件路径;默认由nonebot-plugin-localstore管理BILIBILI_LIVE_NOTIFY_MANAGED_ROOMS_FILE: 维护待监听房间列表的文件路径BILIBILI_LIVE_NOTIFY_EXPORT_FILE: 导出的BILIBILI_LIVE_BOTS配置文件路径
直播事件来源由 nonebot-adapter-bilibili-live 提供,你还需要配置它的 BILIBILI_LIVE_BOTS。
Web Bot 示例:
DRIVER=~httpx+~websockets
BILIBILI_LIVE_BOTS='
[
{
"cookie": "SESSDATA=xxxxxxxxxxxxxxxx; bili_jct=xxxxxxxxxxxxx;",
"room_ids": [711308, 12345]
}
]
'
使用说明
在群内使用:
订阅直播 711308 狂肝无尽狂潮
参与直播 711308
直播订阅列表
支持指令:
直播帮助订阅直播 <房间号> [备注]取消订阅直播 <房间号|备注>备注直播 <房间号|旧备注> <新备注>直播监听列表更新直播监听配置导出直播监听配置参与直播 <房间号|备注>取消参与直播 <房间号|备注>直播订阅列表我参与的直播
重要说明
nonebot-adapter-bilibili-live 静态监听房间配置,本插件会额外维护一份“待监听房间列表”:
- 群里执行
订阅直播时,如果该房间尚未被适配器监听,插件会自动把它加入待监听列表。 - 插件会立刻尝试在当前进程里补挂监听,并自动刷新导出的适配器配置文件。
- 管理员通常只需要正常订阅;只有在想检查状态时再用
直播监听列表,或在自动补挂失败时手动执行更新直播监听配置。 - 如果希望下次重启后仍然保留这些房间,再将自动导出的文件内容同步到
BILIBILI_LIVE_BOTS。
说明:
- 为了避免在群消息里直接暴露 Cookie,插件会把导出结果写到本地文件,而不是直接回显完整配置。
- 当前默认会把“待监听房间”并入第一个可用的
bilibili-liveWeb Bot 配置中。 更新直播监听配置依赖适配器内部实现做运行时补挂,适合提升使用体验;真正的长期持久化仍以导出后的BILIBILI_LIVE_BOTS为准。- 插件在订阅和取消订阅后都会自动刷新导出文件,因此通常不需要再手动执行
导出直播监听配置。
定位
nonebot-adapter-bilibili-live 负责“监听直播事件”。
本插件负责“群订阅管理、成员报名、按参与名单提醒、下播通知、持久化”。
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_bilibili_live_notify-0.2.0.tar.gz.
File metadata
- Download URL: nonebot_plugin_bilibili_live_notify-0.2.0.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f20d2191b8eb924212d0f758ba652aead59e6ea12db35b3adfc9bc3a4574acf
|
|
| MD5 |
e3e400506e9beae021717f955a4ab0ff
|
|
| BLAKE2b-256 |
5443cf47906c387e37c07f9ff312f2a45a0f573b3d1982010d6df98c2a3ec695
|
Provenance
The following attestation bundles were made for nonebot_plugin_bilibili_live_notify-0.2.0.tar.gz:
Publisher:
publish.yml on ArisaTaki/nonebot-plugin-bilibili-live-notify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_bilibili_live_notify-0.2.0.tar.gz -
Subject digest:
1f20d2191b8eb924212d0f758ba652aead59e6ea12db35b3adfc9bc3a4574acf - Sigstore transparency entry: 1187398937
- Sigstore integration time:
-
Permalink:
ArisaTaki/nonebot-plugin-bilibili-live-notify@4afee6bdd1d228de0f5706737e7a9e92790a260d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ArisaTaki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4afee6bdd1d228de0f5706737e7a9e92790a260d -
Trigger Event:
release
-
Statement type:
File details
Details for the file nonebot_plugin_bilibili_live_notify-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_bilibili_live_notify-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c2e3246e9d9f473e355a2673d95deae482d5facae81002cc4071a67d1b6a9e1
|
|
| MD5 |
41aae9afe2d63eeb9d09d2f7b97f12f7
|
|
| BLAKE2b-256 |
25073bbcfd2a30a9b69ae910d34611ce87796564cf817eae2e8d14996bcd918d
|
Provenance
The following attestation bundles were made for nonebot_plugin_bilibili_live_notify-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on ArisaTaki/nonebot-plugin-bilibili-live-notify
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_bilibili_live_notify-0.2.0-py3-none-any.whl -
Subject digest:
7c2e3246e9d9f473e355a2673d95deae482d5facae81002cc4071a67d1b6a9e1 - Sigstore transparency entry: 1187398942
- Sigstore integration time:
-
Permalink:
ArisaTaki/nonebot-plugin-bilibili-live-notify@4afee6bdd1d228de0f5706737e7a9e92790a260d -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ArisaTaki
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4afee6bdd1d228de0f5706737e7a9e92790a260d -
Trigger Event:
release
-
Statement type: