兼容喵崽合并消息type

喵崽解析的合并消息type是forward,resid也是直接在val.id属性。

Signed-off-by: AFanSKyQs <3141865879@qq.com>
This commit is contained in:
AFanSKyQs 2023-03-08 06:19:14 +00:00 committed by Gitee
parent 29e1c446a7
commit 1a16ab2ea4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -53,8 +53,14 @@ export async function uploadCharacterImg (e) {
for (let val of source.message) {
if (val.type === 'image') {
imageMessages.push(val)
} else if (val.type === 'xml') { // 支持合并转发消息内置的图片批量上传,喵喵 喵喵喵? 喵喵喵喵
let resid = val.data.match(/m_resid="(\d|\w|\/|\+)*"/)[0].replace(/m_resid=|"/g, '')
} else if (val.type === 'xml' || val.type === 'forward') {// 支持合并转发消息内置的图片批量上传,喵喵 喵喵喵? 喵喵喵喵
let resid
try {
resid = val.data.match(/m_resid="(\d|\w|\/|\+)*"/)[0].replace(/m_resid=|"/g, '')
} catch (err) {
console.log('Miao合并上传转换id获取')
resid = val.id
}
if (!resid) break
let message = await Bot.getForwardMsg(resid)
for (const item of message) {