From 94f16c4f8be652bc6606f8589995b57181acd86e Mon Sep 17 00:00:00 2001 From: taylorxie Date: Mon, 9 Mar 2026 18:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maubot_llmplus/aibot.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index 9bd8cc9..8729a48 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -130,12 +130,12 @@ class AiBotPlugin(AbsExtraConfigPlugin): # 关闭typing提示 await self.client.set_typing(event.room_id, timeout=0) # 打开typing提示 - if chat_completion.message['result']: - if hasattr(chat_completion.message, 'content'): - resp_content = chat_completion.message['content'] - response = TextMessageEventContent(msgtype=MessageType.TEXT, body=resp_content, format=Format.HTML, - formatted_body=markdown.render(resp_content)) - await event.respond(response, in_thread=self.config['reply_in_thread']) + if chat_completion.result: + # if hasattr(chat_completion.message, 'content'): + resp_content = chat_completion.message['content'] + response = TextMessageEventContent(msgtype=MessageType.TEXT, body=resp_content, format=Format.HTML, + formatted_body=markdown.render(resp_content)) + await event.respond(response, in_thread=self.config['reply_in_thread']) else: resp_content = "调用失败,请检查: " + chat_completion.finish_reason response = TextMessageEventContent(msgtype=MessageType.TEXT, body=resp_content, format=Format.HTML,