发送文件 URL 加上 file:// (#533)

This commit is contained in:
时雨◎星空 2023-03-28 12:55:36 +08:00 committed by GitHub
parent 1d27a4be4d
commit 86cfca8da0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,7 @@ let Avatar = {
} }
let bg = char.getCardImg(Cfg.get('charPicSe', false)) let bg = char.getCardImg(Cfg.get('charPicSe', false))
if (renderType === 'photo') { if (renderType === 'photo') {
e.reply(segment.image(process.cwd() + '/plugins/miao-plugin/resources/' + bg.img)) e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/${bg.img}`))
return true return true
} }
let uid = e.uid || (e.targetUser && e.targetUser.uid) let uid = e.uid || (e.targetUser && e.targetUser.uid)

View File

@ -234,7 +234,7 @@ export async function profileImgList (e) {
// 合并转发最多99 但是我感觉不会有这么多先不做处理 // 合并转发最多99 但是我感觉不会有这么多先不做处理
console.log(`${path}${imgs[i]}`) console.log(`${path}${imgs[i]}`)
msglist.push({ msglist.push({
message: [`${i + 1}.`, segment.image(`${path}/${imgs[i]}`)], message: [`${i + 1}.`, segment.image(`file://${path}/${imgs[i]}`)],
nickname: nickname, nickname: nickname,
user_id: Bot.uin user_id: Bot.uin
}) })

View File

@ -44,7 +44,7 @@ export async function getOriginalPicture (e) {
} }
} }
if (imgPath && imgPath.img) { if (imgPath && imgPath.img) {
e.reply([segment.image(process.cwd() + '/plugins/miao-plugin/resources/' + decodeURIComponent(imgPath.img))], false, { recallMsg: 30 }) e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/${decodeURIComponent(imgPath.img)}`), false, { recallMsg: 30 })
} }
return true return true
} }
@ -52,7 +52,7 @@ export async function getOriginalPicture (e) {
let time = new Date() let time = new Date()
// 对at错图像的增加嘲讽... // 对at错图像的增加嘲讽...
if (time / 1000 - source.time < 3600) { if (time / 1000 - source.time < 3600) {
e.reply([segment.image(process.cwd() + '/plugins/miao-plugin/resources/common/face/what.jpg')]) e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/common/face/what.jpg`))
return true return true
} }
} }

View File

@ -53,7 +53,7 @@ const CharWiki = {
if (mode === 'pic') { if (mode === 'pic') {
let img = char.getCardImg(Cfg.get('charPicSe', false), false) let img = char.getCardImg(Cfg.get('charPicSe', false), false)
if (img && img.img) { if (img && img.img) {
e.reply(segment.image(process.cwd() + '/plugins/miao-plugin/resources/' + img.img)) e.reply(segment.image(`file://${process.cwd()}/plugins/miao-plugin/resources/${img.img}`))
} else { } else {
e.reply('暂无图片') e.reply('暂无图片')
} }