fix: 试图拿到更完整的群聊信息

This commit is contained in:
ikechan8370 2023-03-26 23:40:01 +08:00
parent 1c79ff00b7
commit 847a623c75
2 changed files with 6 additions and 1 deletions

View file

@ -1023,6 +1023,11 @@ export class chatgpt extends plugin {
chats.push(...chatHistory)
}
chats = chats.slice(0, Config.groupContextLength)
let mm = await e.group.getMemberMap()
chats.forEach(chat => {
let sender = mm.get(chat.sender.user_id)
chat.sender = sender
})
console.log(chats)
opt.chats = chats
}