Skip to main content

nonebot-plugin-bilibili-live-notify

基于 nonebot-adapter-bilibili-live 的 NoneBot2 插件,专注于 QQ 群内的 B 站直播订阅管理:

  • 群管理员订阅直播间
  • 群成员自行加入或退出提醒名单
  • 开播 / 下播自动推送
  • 按参与成员进行 @ 提醒
  • 本地持久化订阅状态

直接消费 nonebot-adapter-bilibili-live 提供的直播事件。

前置要求

  • NoneBot2 >= 2.4.2
  • nonebot-adapter-onebot
  • nonebot-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 静态监听房间配置,本插件会额外维护一份“待监听房间列表”:

  1. 群里执行 订阅直播 时,如果该房间尚未被适配器监听,插件会自动把它加入待监听列表。
  2. 插件会立刻尝试在当前进程里补挂监听,并自动刷新导出的适配器配置文件。
  3. 管理员通常只需要正常订阅;只有在想检查状态时再用 直播监听列表,或在自动补挂失败时手动执行 更新直播监听配置。
  4. 如果希望下次重启后仍然保留这些房间,再将自动导出的文件内容同步到 BILIBILI_LIVE_BOTS。

说明:

  • 为了避免在群消息里直接暴露 Cookie,插件会把导出结果写到本地文件,而不是直接回显完整配置。
  • 当前默认会把“待监听房间”并入第一个可用的 bilibili-live Web Bot 配置中。
  • 更新直播监听配置 依赖适配器内部实现做运行时补挂,适合提升使用体验;真正的长期持久化仍以导出后的 BILIBILI_LIVE_BOTS 为准。
  • 插件在订阅和取消订阅后都会自动刷新导出文件,因此通常不需要再手动执行 导出直播监听配置。

定位

nonebot-adapter-bilibili-live 负责“监听直播事件”。

本插件负责“群订阅管理、成员报名、按参与名单提醒、下播通知、持久化”。

License

MIT

Metadata

Release files for nonebot-plugin-bilibili-live-notify 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-bilibili-live-notify 0.2.0
File Size Uploaded
nonebot_plugin_bilibili_live_notify-0.2.0.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nonebot-plugin-bilibili-live-notify 0.2.0
File Interpreter ABI Platform
nonebot_plugin_bilibili_live_notify-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.2 kB

Release files / nonebot_plugin_bilibili_live_notify-0.2.0.tar.gz

Download URL nonebot_plugin_bilibili_live_notify-0.2.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1f20d2191b8eb924212d0f758ba652aead59e6ea12db35b3adfc9bc3a4574acf
BLAKE2b-256 checksum
How to use checksums
5443cf47906c387e37c07f9ff312f2a45a0f573b3d1982010d6df98c2a3ec695
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

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

Download URL nonebot_plugin_bilibili_live_notify-0.2.0-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c2e3246e9d9f473e355a2673d95deae482d5facae81002cc4071a67d1b6a9e1
BLAKE2b-256 checksum
How to use checksums
25073bbcfd2a30a9b69ae910d34611ce87796564cf817eae2e8d14996bcd918d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 27, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

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