feat(message_summary): beautify overview stats pills
This commit is contained in:
@@ -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()}"
|
||||
|
||||
Reference in New Issue
Block a user