mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-16 04:35:42 +00:00
修正部分问题 (#342)
This commit is contained in:
parent
7feebe2928
commit
8881f5a881
@ -54,7 +54,7 @@ export async function uploadCharacterImg (e) {
|
|||||||
if (val.type === 'image') {
|
if (val.type === 'image') {
|
||||||
imageMessages.push(val)
|
imageMessages.push(val)
|
||||||
} else if (val.type === 'xml') { // 支持合并转发消息内置的图片批量上传,喵喵 喵喵喵? 喵喵喵喵
|
} 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
|
if (!resid) break
|
||||||
let message = await Bot.getForwardMsg(resid)
|
let message = await Bot.getForwardMsg(resid)
|
||||||
for (const item of message) {
|
for (const item of message) {
|
||||||
@ -132,7 +132,7 @@ async function saveImages (e, name, imageMessages) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function isAllowedToUploadCharacterImage (e) {
|
async function isAllowedToUploadCharacterImage (e) {
|
||||||
let sendMsg = e.msg.includes('上传') ? '添加' : '删除'
|
let sendMsg = /上传|添加/.test(e.msg) ? '添加' : '删除'
|
||||||
if (!e.message) {
|
if (!e.message) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ export async function getOriginalPicture (e) {
|
|||||||
if (source) {
|
if (source) {
|
||||||
let imgPath = await redis.get(`miao:original-picture:${source.message_id}`)
|
let imgPath = await redis.get(`miao:original-picture:${source.message_id}`)
|
||||||
if (imgPath) {
|
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
|
return true
|
||||||
}
|
}
|
||||||
if (source.time) {
|
if (source.time) {
|
||||||
|
Loading…
Reference in New Issue
Block a user