nonebot-plugin-morningpaper
NoneBot2 群聊早报插件,支持 RSS 新闻、浙江宣传、农历标题和定时推送。适用于 OneBot V11。
使用方式
私聊或群聊发送以下文字,无需命令前缀:
| 消息 | 功能 | 权限 |
|---|---|---|
早报 |
查看当前早报 | 所有人 |
发送早报 |
群聊推送到当前群,私聊推送到配置群 | 超级用户 |
默认每天北京时间 08:00 推送最近 24 小时的新闻,最多 12 条。显示农历、原标题、来源和链接,不显示分类小标题,不调用 AI。
配置项
在 NoneBot 的 .env.prod 中添加,需要什么加什么:
# 定时推送的 QQ 群;不填时仍可手动查看早报
MORNINGPAPER_GROUPS=[123456789]
# 每天的发报时间,24 小时制 HH:MM,默认时区为北京时间
MORNINGPAPER_TIME="08:00"
# 可选:自定义 YAML 路径,不填使用内置配置
# MORNINGPAPER_CONFIG="./morning_news.yaml"
# 整份早报最多条数
MORNINGPAPER_MAX_ITEMS=12
# 浙江宣传:是否启用、最多条数
MORNINGPAPER_ZHEJIANG_ENABLED=true
MORNINGPAPER_ZHEJIANG_COUNT=1
# 国内要闻:是否启用、最多条数
MORNINGPAPER_DOMESTIC_ENABLED=true
MORNINGPAPER_DOMESTIC_COUNT=2
| 配置项 | 类型 | 默认值 |
|---|---|---|
MORNINGPAPER_GROUPS |
list[int] |
[] |
MORNINGPAPER_CONFIG |
文件路径 | 优先使用运行目录同名 YAML,否则使用内置配置 |
MORNINGPAPER_TIME |
str,格式 HH:MM |
YAML 中的 schedule.time,内置为 08:00 |
MORNINGPAPER_MAX_ITEMS |
int |
YAML 中的 output.max_items,内置为 12 |
每个来源均可通过 MORNINGPAPER_<ID大写>_ENABLED 和 MORNINGPAPER_<ID大写>_COUNT 控制。环境配置优先于 YAML;设为 false 或条数 0 均停止获取该来源。
例如 MORNINGPAPER_TIME="08:30" 表示每天 08:30 发报,使用 YAML 中的 schedule.timezone 时区;修改后重启生效。时间格式错误会报错。
| ID | 来源 | 默认条数 |
|---|---|---|
zhejiang |
浙江宣传(浙江在线转载) | 1 |
domestic |
中新网时政 | 2 |
society |
中新网社会 | 1 |
finance |
中新网财经 | 1 |
world |
中新网国际 | 3 |
people_world |
人民网国际 | 1 |
ithome |
IT之家 | 1 |
health |
中新网健康 | 1 |
science |
科学网 | 1 |
全部来源默认启用,按配置顺序分配配额,整份早报仍受总条数上限限制。自定义来源、推送时间、时区和显示项可参照 morning_news.yaml,修改配置后重启机器人。
相同链接或标题会去重,新闻不足时不使用旧闻补位。浙江宣传读取官方转载栏目,更新可能晚于公众号;各订阅可能停更或失效,可自行关闭或更换。
安装
使用 nb-cli 安装(推荐),自动添加插件加载项:
nb plugin install nonebot-plugin-morningpaper
或使用 pip 安装:
pip install --upgrade nonebot-plugin-morningpaper
pip 安装后,在 pyproject.toml 已有的 [tool.nonebot] 插件列表中加入:
[tool.nonebot]
plugins = ["nonebot_plugin_morningpaper"]
从 GitHub 安装开发版:
pip install --upgrade git+https://github.com/imcoda/nonebot-plugin-morningpaper.git
Metadata
Release files for nonebot-plugin-morningpaper 0.3.2
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 | |
|---|---|---|---|---|
| nonebot_plugin_morningpaper-0.3.2.tar.gz | 9.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nonebot_plugin_morningpaper-0.3.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.8 kB
Release files / nonebot_plugin_morningpaper-0.3.2.tar.gz
| Download URL | nonebot_plugin_morningpaper-0.3.2.tar.gz |
|---|---|
| Size | 9.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9758443220427a5d7d0dca675b7f7948f86d8ee0b07f88ffc633c0e0162bae59
|
|
BLAKE2b-256 checksum How to use checksums |
d07d95af6fd7c102b9bc117ee8c4f23a3249865379c8aad16d11720aaf2975ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Release files / nonebot_plugin_morningpaper-0.3.2-py3-none-any.whl
| Download URL | nonebot_plugin_morningpaper-0.3.2-py3-none-any.whl |
|---|---|
| Size | 11.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd8a67c46d195720655acc7e7a20fac05c52e75d1b5e3c672c75bba8c6aafc41
|
|
BLAKE2b-256 checksum How to use checksums |
419bb99ced6f8f75c257d2b5941a2c0558bb092cc9122b6349092606f86e8b6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Security for nonebot-plugin-morningpaper 0.3.2
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.