fix: 撤回tool的问题

This commit is contained in:
ikechan8370 2023-06-26 14:59:18 +08:00
parent ca28b00679
commit aed271479d

View file

@ -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}`
}
}
}