From 1e3ecd5efc7da96494d6bf79476644720d345e92 Mon Sep 17 00:00:00 2001 From: zhiyu1998 Date: Mon, 6 Mar 2023 23:44:27 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=88=20perf:=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=B0=8F=E7=BA=A2=E4=B9=A6=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/tools.js b/apps/tools.js index 92c5caf..eaf1c9c 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -535,8 +535,10 @@ export class tools extends plugin { }); }) }) + let path = [] const images = await Promise.all(imagesPath).then(paths => { return paths.map(item => { + path.push(item) return { message: segment.image(fs.readFileSync(item)), nickname: e.sender.card || e.user_id, @@ -545,6 +547,10 @@ export class tools extends plugin { }) }) await this.reply(await Bot.makeForwardMsg(images)); + // 清理文件 + path.forEach(item => { + fs.fs.unlinkSync(item); + }) }); return true;