Skip to content

[Bug] 分段回复导致QQ消息出现多余空行 #8300

@lucy1501126095-tech

Description

@lucy1501126095-tech

发生了什么

开启分段回复后,QQ消息每段之间出现大量多余空行。关闭分段回复后恢复正常。

原因

astrbot/core/pipeline/result_decorate/stage.py 中,分段后的文本片段未 strip 就存入 chain:

if seg.strip():
    new_chain.append(Plain(seg))  # seg 未 strip,保留了首尾换行

修复建议

if seg.strip():
    new_chain.append(Plain(seg.strip()))

版本信息

  • AstrBot: v4.25.1
  • 消息平台适配器: aiocqhttp
  • 协议端: NapCat
  • 部署方式: Docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:platformThe bug / feature is about IM platform adapter, such as QQ, Lark, Telegram, WebChat and so on.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions