修复:群聊图片发送后延迟1秒再发文字,确保消息顺序正确

This commit is contained in:
2026-03-19 10:01:46 +08:00
parent e14450edbc
commit 6993ef4f2a

View File

@@ -8,6 +8,7 @@
- 卡片更新:按钮点击后更新卡片状态
"""
import asyncio
import httpx
import time
from typing import Optional, List, Dict
@@ -615,6 +616,9 @@ class WeChatService:
if not sent:
success = False
logger.warning(f"群聊截图发送失败: alarm={alarm_id}")
else:
# 等待企微完成图片投递,避免后续文字消息先于图片到达
await asyncio.sleep(1)
else:
logger.warning(f"截图上传企微失败,跳过图片消息: alarm={alarm_id}")