From aed271479d65303a09bb33fb9f09e7301402fd05 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Mon, 26 Jun 2023 14:59:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=92=A4=E5=9B=9Etool=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/chat.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/chat.js b/apps/chat.js index 340201f..a94f0eb 100644 --- a/apps/chat.js +++ b/apps/chat.js @@ -2007,8 +2007,9 @@ export class chatgpt extends plugin { tools.push(...[new EditCardTool(), new JinyanTool(), new KickOutTool(), new HandleMessageMsgTool()]) // 用于撤回和加精的id option.systemMessage += `\nthis last message id is ${e.message_id}` - if (e.source?.message_id) { - option.systemMessage += `\nthis last message is replying to ${e.source.message_id}: ${(await e.group.getChatHistory(e.source.seq, 1)).pop()?.raw_message}` + if (e.source?.seq) { + let source = (await e.group.getChatHistory(e.source?.seq, 1)).pop() + option.systemMessage += `\nthis last message is replying to ${source.message_id}: ${source?.raw_message}` } } }