mirror of
https://github.com/Nezumi-2711/astrbot_plugin_qq_group_daily_analysis.git
synced 2026-09-23 04:09:59 +00:00
[v4.11.2] - 🛠️ 定时报告可同时发送多种格式,可关闭报告发送时的 “📊 每日群聊分析报告已生成” 文字前缀
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user