NoneBot2 插件:拦截所有图片消息并注入摘要/外显文本。
Project description
nonebot-plugin-image-summary
📖 简介
NoneBot2 图片外显更改
这是一个能够拦截Nonebot2发送的所有图片消息,并自动在图片下方注入 summary(外显)字段的插件。
支持API 获取和本地文案两种模式,且拥有群白名单管理机制。
💿 安装
1.使用nb安装
#进入你的nb文件夹
nb plugin install nonebot-plugin-image-summary
2.使用pip
#进入你的nb文件夹
pip install nonebot-plugin-image-summary
确保目录结构正确:
lib/python3.11/site-packages/nonebot_plugin_image_summary/
├── __init__.py
├── config.py
└── data_manager.py
并且到pyproject.toml中添加代码
plugins =["nonebot_plugin_image_summary"]
⚙️ 配置
在 .env 或 .env.prod 中添加以下配置(可选):
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| IMAGE_SUMMARY_APIS | List[str] | (见下方) | 获取外显文案的 API 列表,插件会随机抽取一个请求。 |
| IMAGE_SUMMARY_DEBUG | bool | False | 是否开启调试模式,开启后控制台会输出详细的 API 请求和注入日志。 |
默认 API 列表:
[
"https://v1.hitokoto.cn/?encode=text",
"https://api.shadiao.pro/du",
"https://api.shadiao.pro/chp"
]
🎮 使用指令
以下指令仅 超级用户 或 群主 可用。
| 指令 | 格式 | 说明 |
|---|---|---|
| 开启外显 | 开启外显 [群号] |
开启当前群(或指定群)的图片外显功能。 |
| 关闭外显 | 关闭外显 [群号] |
关闭当前群(或指定群)的图片外显功能。 |
| 切换外显源 | 切换外显源 |
在 local (本地库) 和 api (网络接口) 模式之间切换。 |
| 外显列表 | 外显列表 |
查看当前模式及本地文案库的前 50 条预览。 |
| 添加外显 | 添加外显 <内容> |
向本地文案库添加一条新内容。 |
| 删除外显 | 删除外显 <内容> |
从本地文案库删除指定内容。 |
提示:插件默认对所有群关闭,必须手动开启才会生效。
📂 数据存储
插件的数据(白名单群号、本地文案、当前模式)保存在机器人运行目录下的: data/image_summary/data.json
你可以手动编辑该文件,修改后无需重启,下一次指令调用或消息发送时会自动读取最新数据。
特别感谢
Project details
Release history Release notifications | RSS feed
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_image_summary-0.1.5.tar.gz.
File metadata
- Download URL: nonebot_plugin_image_summary-0.1.5.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51a08c1688f24e28314013a06ab429974f9386abf1d9ebcac86492bdc71686a7
|
|
| MD5 |
77eb353b1f817d8c12f32935ef953ddb
|
|
| BLAKE2b-256 |
a576c237dfe7ff107e5b2ee56dfd1b795b10aa0469c41d7291d0f18379acb00f
|
Provenance
The following attestation bundles were made for nonebot_plugin_image_summary-0.1.5.tar.gz:
Publisher:
python-publish.yml on TZJackZ2B9S/nonebot_plugin_image_summary
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_image_summary-0.1.5.tar.gz -
Subject digest:
51a08c1688f24e28314013a06ab429974f9386abf1d9ebcac86492bdc71686a7 - Sigstore transparency entry: 760762244
- Sigstore integration time:
-
Permalink:
TZJackZ2B9S/nonebot_plugin_image_summary@fd704413edcf396f156ceffa464e437adf34d6f4 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/TZJackZ2B9S
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fd704413edcf396f156ceffa464e437adf34d6f4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nonebot_plugin_image_summary-0.1.5-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_image_summary-0.1.5-py3-none-any.whl
- Upload date:
- Size: 7.1 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 |
5cea9e02a094d627195e8255dd27a5b2afe7d8e10eafc578301f332d99cd367f
|
|
| MD5 |
4e901433519f25e476bf26600abd732e
|
|
| BLAKE2b-256 |
868f4a3becb545789fc11dbd3859fda71be67d91847a7b01101ba2d401887542
|
Provenance
The following attestation bundles were made for nonebot_plugin_image_summary-0.1.5-py3-none-any.whl:
Publisher:
python-publish.yml on TZJackZ2B9S/nonebot_plugin_image_summary
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_image_summary-0.1.5-py3-none-any.whl -
Subject digest:
5cea9e02a094d627195e8255dd27a5b2afe7d8e10eafc578301f332d99cd367f - Sigstore transparency entry: 760762245
- Sigstore integration time:
-
Permalink:
TZJackZ2B9S/nonebot_plugin_image_summary@fd704413edcf396f156ceffa464e437adf34d6f4 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/TZJackZ2B9S
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@fd704413edcf396f156ceffa464e437adf34d6f4 -
Trigger Event:
push
-
Statement type: