修正部分问题 (#342)

This commit is contained in:
cvs 2022-12-05 02:58:05 +08:00 committed by GitHub
parent 7feebe2928
commit 8881f5a881
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ export async function uploadCharacterImg (e) {
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, '')
let resid = val.data.match(/m_resid="(\d|\w|\/|\+)*"/)[0].replace(/m_resid=|"/g, '')
if (!resid) break
let message = await Bot.getForwardMsg(resid)
for (const item of message) {
@ -132,7 +132,7 @@ async function saveImages (e, name, imageMessages) {
}
async function isAllowedToUploadCharacterImage (e) {
let sendMsg = e.msg.includes('上传') ? '添加' : '删除'
let sendMsg = /上传|添加/.test(e.msg) ? '添加' : '删除'
if (!e.message) {
return false
}

View File

@ -24,7 +24,7 @@ export async function getOriginalPicture (e) {
if (source) {
let imgPath = await redis.get(`miao:original-picture:${source.message_id}`)
if (imgPath) {
e.reply([segment.image(process.cwd() + '/plugins/miao-plugin/resources/' + imgPath)])
e.reply([segment.image(process.cwd() + '/plugins/miao-plugin/resources/' + decodeURIComponent(imgPath))])
return true
}
if (source.time) {