Files
abot/plugins/github_opengraph/README.md
liuwei 40ba461418 新增GitHub OpenGraph插件:自动解析GitHub链接并发送预览图
变更项:

1. 新增 github_opengraph 插件主逻辑,支持 fuzzy/exact 两种匹配模式。

2. 新增群功能权限注册(GITHUB_OPENGRAPH),对齐现有群权限开关机制。

3. 实现 GitHub 链接标准化、去重、限流、OpenGraph URL 生成与图片下载发送。

4. 新增 config.toml,提供 enable、match_mode、max_links_per_message、hash_salt、request_timeout_seconds 配置。

5. 新增 README 使用说明与示例。
2026-04-22 11:40:17 +08:00

32 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# GitHub OpenGraph 插件
## 功能说明
自动识别群聊/私聊中的 `github.com` 链接,将其转换为 GitHub OpenGraph 预览图并发送图片消息。
## 触发规则
1. `fuzzy` 模式:消息中只要包含 GitHub 链接就会触发。
2. `exact` 模式:消息内容必须是完整 GitHub 链接才会触发。
## 权限控制
插件注册了群功能开关:
- `FEATURE_KEY`: `GITHUB_OPENGRAPH`
- `FEATURE_DESCRIPTION`: `🧩 GitHub链接卡片 [自动转OpenGraph图片]`
如果某群关闭该功能,该群消息不会触发处理。
## 配置项
见 [config.toml](/D:/learn/abot/plugins/github_opengraph/config.toml)
- `enable`:总开关
- `match_mode`:匹配模式(`fuzzy` / `exact`
- `max_links_per_message`:单条消息最大处理链接数
- `hash_salt`OpenGraph 哈希盐值
- `request_timeout_seconds`:拉图超时秒数
## 典型示例
原链接:
`https://github.com/python/cpython/issues/12345`
转换后:
`https://opengraph.githubassets.com/<hash>/python/cpython/issues/12345`