fix(chat): 处理响应数据为列表时的情况

当响应内容`data`是一个列表时,将其所有元素连接成一个字符串,以避免在后续处理中因类型不匹配而引发的错误。
This commit is contained in:
minecraft1024a
2025-09-06 16:03:52 +08:00
parent a3d0588e7e
commit d16df808ef
2 changed files with 3 additions and 0 deletions

1
.gitignore vendored
View File

@@ -336,3 +336,4 @@ MaiBot.code-workspace
/tests /tests
/tests /tests
.kilocode/rules/MoFox.md .kilocode/rules/MoFox.md
src/chat/planner_actions/planner (2).py

View File

@@ -155,6 +155,8 @@ class ResponseHandler:
else: else:
data = reply_seg["content"] data = reply_seg["content"]
if isinstance(data, list):
data = "".join(map(str, data))
reply_text += data reply_text += data
# 如果是主动思考且内容为“沉默”,则不发送 # 如果是主动思考且内容为“沉默”,则不发送