mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: 修复和优化群聊文件读取逻辑
This commit is contained in:
parent
d254163fa7
commit
e61d4ff3fa
3 changed files with 17 additions and 6 deletions
|
|
@ -1674,8 +1674,8 @@ export class chatgpt extends plugin {
|
|||
seq = e.source.message_id
|
||||
}
|
||||
let msgs = e.isGroup ? await e.group.getChatHistory(seq, 1) : await e.friend.getChatHistory(seq, 1)
|
||||
let sourceMsg = msgs[0]
|
||||
let fileMsgElem = sourceMsg.message.find(msg => msg.type === 'file')
|
||||
let sourceMsg = msgs[msgs.length - 1]
|
||||
let fileMsgElem = sourceMsg.file || sourceMsg.message.find(msg => msg.type === 'file')
|
||||
if (fileMsgElem) {
|
||||
toSummaryFileContent = await extractContentFromFile(fileMsgElem, e)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue