[v4.11.2] - 🛠️ 定时报告可同时发送多种格式,可关闭报告发送时的 “📊 每日群聊分析报告已生成” 文字前缀

This commit is contained in:
SXP-Simon
2026-07-21 16:33:00 +08:00
parent 938ae5ddaf
commit 04fa154a28
7 changed files with 29 additions and 12 deletions
+3 -1
View File
@@ -498,7 +498,9 @@ class ConfigManager:
def set_output_format(self, format_types: str | list[str]):
"""设置输出格式"""
if isinstance(format_types, str):
format_types = [f.strip() for f in format_types.replace("", ",").split(",")]
format_types = [
f.strip() for f in format_types.replace("", ",").split(",")
]
for f in format_types:
if f not in ("image", "text", "html"):
raise ValueError(f"无效格式: {f}。有效: image, text, html")
+10 -2
View File
@@ -100,7 +100,11 @@ class ReportDispatcher:
# 4. 发送图片
sent = False
if image_url:
caption = TraceContext.make_report_caption() if self.config_manager.get_show_report_caption() else ""
caption = (
TraceContext.make_report_caption()
if self.config_manager.get_show_report_caption()
else ""
)
sent = await self.message_sender.send_image_smart(
group_id, image_url, caption, platform_id
)
@@ -180,7 +184,11 @@ class ReportDispatcher:
f"[{trace_id}] 群 {group_id} 开启了仅发送外链,但未配置 html_base_url,已进行降级,回退至发送 HTML 文件。"
)
caption = self.report_generator.build_html_caption(html_path) if self.config_manager.get_show_report_caption() else ""
caption = (
self.report_generator.build_html_caption(html_path)
if self.config_manager.get_show_report_caption()
else ""
)
sent = await self.message_sender.send_file(
group_id,