Skip to main content

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

你可以手动编辑该文件,修改后无需重启,下一次指令调用或消息发送时会自动读取最新数据。

特别感谢

astrbot_plugin_image_summary

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

nonebot_plugin_image_summary-0.1.5.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_image_summary-0.1.5-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_image_summary-0.1.5.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_image_summary-0.1.5.tar.gz
Algorithm Hash digest
SHA256 51a08c1688f24e28314013a06ab429974f9386abf1d9ebcac86492bdc71686a7
MD5 77eb353b1f817d8c12f32935ef953ddb
BLAKE2b-256 a576c237dfe7ff107e5b2ee56dfd1b795b10aa0469c41d7291d0f18379acb00f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_image_summary-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_image_summary-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5cea9e02a094d627195e8255dd27a5b2afe7d8e10eafc578301f332d99cd367f
MD5 4e901433519f25e476bf26600abd732e
BLAKE2b-256 868f4a3becb545789fc11dbd3859fda71be67d91847a7b01101ba2d401887542

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page