feat(message_summary): beautify overview stats pills

This commit is contained in:
liuwei
2026-04-13 09:54:42 +08:00
parent 8ccf96d6de
commit b10ec3493a
2 changed files with 96 additions and 3 deletions

View File

@@ -528,11 +528,19 @@ class MessageSummaryPlugin(MessagePluginInterface):
if not summary or not summary.strip():
return summary
pairs = [
("", int(stats.get("total_count") or 0)),
("人数", int(stats.get("participant_count") or 0)),
("文本", int(stats.get("text_count") or 0)),
("图片", int(stats.get("image_count") or 0)),
("视频", int(stats.get("video_count") or 0)),
("链接", int(stats.get("link_count") or 0)),
("表情", int(stats.get("emoji_count") or 0)),
]
stats_line = " · ".join([f"**{label}** {value}" for label, value in pairs])
section_lines = [
"## 群概览",
f"- 📊 总:{int(stats.get('total_count') or 0)} 👥 人:{int(stats.get('participant_count') or 0)}\n"
f"- 💬 文:{int(stats.get('text_count') or 0)} 🖼 图:{int(stats.get('image_count') or 0)} 🎬 视:{int(stats.get('video_count') or 0)}\n"
f"- 🔗 链:{int(stats.get('link_count') or 0)} 😄 表:{int(stats.get('emoji_count') or 0)}"
stats_line,
]
section = "\n".join(section_lines)
return f"{section}\n\n{summary.strip()}"