diff --git a/apps/character/character-img-upload.js b/apps/character/character-img-upload.js index cbc1dc98..458cc1cb 100644 --- a/apps/character/character-img-upload.js +++ b/apps/character/character-img-upload.js @@ -42,8 +42,22 @@ export async function uploadCharacterImg (e) { imageMessages.push(val) } } + let source + if (e.isGroup) {// 支持at图片添加,以及支持后发送 + source = (await e.group.getChatHistory(e.source.seq, 1)).pop() + } else { + source = (await e.friend.getChatHistory(e.source.time, 1)).pop() + } + if (source) { + for (let val of source.message) { + if (val.type === 'image') { + imageMessages.push(val) + } + } + } + if (imageMessages.length <= 0) { - // TODO 支持at图片添加,以及支持后发送 + e.reply('消息中未找到图片,请将要发送的图片与消息一同发送..') return true }