From 8ec0627abda5b693dd8f3332a9fb5e7376ad872e Mon Sep 17 00:00:00 2001 From: zhiyu <542716863@qq.com> Date: Fri, 10 May 2024 19:12:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index e7aa24a..c8b0724 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1733,10 +1733,6 @@ export class tools extends plugin { * @param videoSizeLimit 发送转上传视频的大小限制,默认70MB */ async sendVideoToUpload(e, path, videoSizeLimit = 70) { - // 判断文件是否存在 - if (!fs.existsSync(path)) { - return e.reply('视频不存在'); - } // 判断是否是拉格朗日 if (await this.isLagRangeDriver()) { // 构造拉格朗日适配器 @@ -1746,6 +1742,10 @@ export class tools extends plugin { // 上传完直接返回 return; } + // 判断文件是否存在 + if (!fs.existsSync(path)) { + return e.reply('视频不存在'); + } const stats = fs.statSync(path); const videoSize = (stats.size / (1024 * 1024)).toFixed(2); if (videoSize > videoSizeLimit) {