🎈 pref: 优化X解析逻辑

This commit is contained in:
zhiyu1998 2024-07-14 22:45:09 +08:00
parent 1bc359cda6
commit eec5741dbd
2 changed files with 5 additions and 5 deletions

View File

@ -770,14 +770,14 @@ export class tools extends plugin {
e.reply(segment.image(url));
} else {
// 非海外使用🪜下载
const proxy = this.myProxy;
const proxy = this.proxyAddr;
const port = this.proxyPort;
const path = this.getCurDownloadPath(e);
downloadImg(url, path, "", !isOversea, {}, {
const localPath = this.getCurDownloadPath(e);
downloadImg(url, localPath, "", isOversea, {}, {
proxyAddr: proxy,
proxyPort: port
}).then(path => {
e.reply(segment.image(fs.readFileSync(path)));
e.reply(segment.image(fs.readFileSync(localPath + "/" + url.split("/").pop())));
});
}
} else {

View File

@ -234,7 +234,7 @@ export async function downloadImg(img, dir, fileName = "", isProxy = false, head
});
});
} catch (err) {
logger.error("图片下载失败");
logger.error(`图片下载失败, 原因:${err}`);
}
}