From d951b997189649c747b809922767ef7cfa47bf91 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Fri, 3 Oct 2025 00:45:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8F=91=E9=80=81=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E5=B0=86=20Plain=20=E4=B8=BA=E7=A9=BA=E7=9A=84=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=AE=B5=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/pipeline/respond/stage.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/astrbot/core/pipeline/respond/stage.py b/astrbot/core/pipeline/respond/stage.py index a674be313..dc6a67e2f 100644 --- a/astrbot/core/pipeline/respond/stage.py +++ b/astrbot/core/pipeline/respond/stage.py @@ -190,6 +190,16 @@ class RespondStage(Stage): except Exception as e: logger.warning(f"空内容检查异常: {e}") + # 将 Plain 为空的消息段移除 + result.chain = [ + comp + for comp in result.chain + if not ( + isinstance(comp, Comp.Plain) + and (not comp.text or not comp.text.strip()) + ) + ] + # 发送消息链 # Record 需要强制单独发送 need_separately = {ComponentType.Record}