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.手动clone

cd path/to/your/site-packages
git clone https://github.com/TZJackZ2B9S/nonebot_plugin_image_summary.git
#网络环境差请自行使用加速站

确保目录结构正确:

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.2.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.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_image_summary-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8eb1dbb2c8d01e8802bc0ede72adb1df0b79966f14ae6bf88474d9f627b2e645
MD5 3f19b8bb4ea1081a62228bc9f6a5caf9
BLAKE2b-256 8db85ff774f0cb4e9e0d27ac6b9d95edfd0967d41de691b4bb3a9dc7b1ef25c7

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_image_summary-0.1.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_image_summary-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4463293902f1e56e988e04d347e1e01c1cd372ffe71719caaabef3313bef3e17
MD5 ef84a7d6b1d44667689d77f2e4f84dd0
BLAKE2b-256 b2123d7fcfbb42dae90b768ba8fea93169a680b3ec0fb7687e2959e639041915

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_image_summary-0.1.2-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