This commit is contained in:
SXP-Simon
2026-03-20 21:07:03 +08:00
parent 3b8e2b85ba
commit f3f93a96c4
4 changed files with 25 additions and 25 deletions
+22 -24
View File
@@ -5,10 +5,20 @@
[![Plugin Version](https://img.shields.io/badge/Latest_Version-v4.9.2-blue.svg?style=for-the-badge&color=76bad9)](https://github.com/SXP-Simon/astrbot-qq-group-daily-analysis)
[![AstrBot](https://img.shields.io/badge/AstrBot-Plugin-ff69b4?style=for-the-badge)](https://github.com/AstrBotDevs/AstrBot)
[![License](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](LICENSE)
[![](https://img.shields.io/badge/五彩斑斓的Bug群-Bug反馈群&水群(QQ)-white?style=for-the-badge&color=76bad9&logo=qq&logoColor=76bad9)](https://qm.qq.com/q/oTzIrdDBIc)
[![](https://img.shields.io/badge/五彩斑斓的Bug群-Bug反馈群&水群(Telegram)-white?style=for-the-badge&color=76bad9&logo=telegram&logoColor=76bad9)](https://t.me/AstrBotPluginGroupDailyAnalysis)
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/SXP-Simon/astrbot_plugin_qq_group_daily_analysis)
<table align="center" style="border: none;">
<tr>
<td style="border: none;" align="center">
<a href="https://qm.qq.com/q/oTzIrdDBIc"><img src="assets/QQ.png" width="300" alt="QQ Group"></a>
</td>
<td style="border: none;" align="center">
<a href="https://t.me/AstrBotPluginGroupDailyAnalysis"><img src="assets/TG.png" width="300" alt="Telegram Group"></a>
</td>
</tr>
</table>
_✨ 一个基于 AstrBot 的智能群聊分析插件,支持 **QQ (OneBot)**、**Telegram**、**Discord**,未来支持更多平台。 [灵感来源](https://github.com/LSTM-Kirigaya/openmcp-tutorial/tree/main/qq-group-summary)。 ✨_
<img src="https://count.getloli.com/@astrbot-qq-group-daily-analysis?name=astrbot-qq-group-daily-analysis&theme=booru-jaypee&padding=6&offset=0&align=top&scale=1&pixelated=1&darkmode=auto" alt="count" />
@@ -221,18 +231,6 @@ _✨ 一个基于 AstrBot 的智能群聊分析插件,支持 **QQ (OneBot)**
## 贡献
<table align="center" width="100%">
<tr>
<td align="center" width="50%" valign="top">
<p><b>项目架构图</b></p>
<img src="https://fastly.jsdelivr.net/gh/SXP-Simon/astrbot_plugin_qq_group_daily_analysis@main/assets/structure-demo.jpg" alt="项目架构图" width="100%">
</td>
<td align="center" width="50%" valign="top">
<p><b>贡献指南</b></p>
<img src="https://fastly.jsdelivr.net/gh/SXP-Simon/astrbot_plugin_qq_group_daily_analysis@main/assets/contribution-guide.jpg" alt="贡献指南" width="100%">
</td>
</tr>
</table>
@@ -265,13 +263,13 @@ pre-commit run --all-files
如果您想为插件贡献新的报告模板,请按照以下步骤操作:
#### 1. 创建模板目录
`src/reports/templates/` 目录下创建一个新的文件夹,例如 `my_theme`
`src/infrastructure/reporting/templates/` 目录下创建一个新的文件夹,例如 `my_theme`
#### 2. 必需文件结构
您的模板目录需要包含以下文件:
```text
src/reports/templates/your_theme_name/
src/infrastructure/reporting/templates/your_theme_name/
├── image_template.html # 图片报告主模板
├── pdf_template.html # PDF报告主模板
├── activity_chart.html # 活跃度图表组件
@@ -283,7 +281,7 @@ src/reports/templates/your_theme_name/
#### 3. 模板变量说明
**主模板 (`image_template.html` / `pdf_template.html`) 可用变量:**
- `current_date`: 当前日期 (YYYY-MM-DD)
- `current_date`: 当前日期 (YYYYMMDD)
- `current_datetime`: 当前时间 (YYYY-MM-DD HH:MM:SS)
- `message_count`: 消息总数
- `participant_count`: 参与人数
@@ -300,18 +298,18 @@ src/reports/templates/your_theme_name/
**组件模板可用变量:**
- `activity_chart.html`: `chart_data` (包含 `hour`, `count`, `percentage` 的列表)
- `topic_item.html`: `topic` (包含 `keyword`, `count`, `summary` 的对象), `loop.index` (序号)
- `user_title_item.html`: `user` (包含 `nickname`, `user_id`, `titles` (列表), `description` 的对象)
- `quote_item.html`: `quote` (包含 `content`, `sender_nickname`, `reason` 的对象)
- `topic_item.html`: `topics` (列表,每一项包含 `index`, `topic` 对象, `contributors`, `detail`)
- `user_title_item.html`: `titles` (列表,包含 `name`, `title`, `mbti`, `reason`, `avatar_data` (Base64))
- `quote_item.html`: `quotes` (列表,包含 `content`, `sender`, `reason`, `avatar_url` (Base64))
#### 4. 参考示例
您可以参考 `src/reports/templates/simple/` 目录下的文件,这是一个最简化的模板实现,包含了所有必需的基本结构。
您可以参考 `src/infrastructure/reporting/templates/simple/` 目录下的文件,这是一个最简化的模板实现,包含了所有必需的基本结构。
#### 5. 模板调试工具
PDF 调试模板命令 Docker 下:
```
```bash
docker exec -it astrbot python data/plugins/astrbot_plugin_qq_group_daily_analysis/scripts/mock_pdf_gen.py
```
@@ -325,7 +323,7 @@ Image 模板调试:
# 进入项目目录
cd astrbot-qq-group-daily-analysis
# 使用默认模板 (retro_futurism) 渲染
# 使用默认模板 (scrapbook) 渲染
python scripts/debug_render.py
# 指定模板名称渲染
@@ -342,7 +340,7 @@ python scripts/debug_render.py -h
- 使用 Mock 数据模拟真实的群聊分析结果
- 无需配置 LLM 服务或启动 AstrBot
- 输出可使用live server打开 HTML 文件,并进行修改查看
- 输出可使用 live server 打开 HTML 文件,并进行修改查看
- 支持所有内置模板的快速切换预览
**开发工作流推荐:**
Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

+3 -1
View File
@@ -521,7 +521,9 @@ class GroupDailyAnalysis(Star):
return
if adapter and orig_msg_id:
await adapter.set_reaction(event.get_group_id(), orig_msg_id, "📊") # 📊
await adapter.set_reaction(
event.get_group_id(), orig_msg_id, "📊"
) # 📊
async for res in self._send_analysis_report(event, result):
yield res