From bc706abfa25f6b1bfac399451b84b03acede0fd1 Mon Sep 17 00:00:00 2001 From: ningmengchongshui <916415899@qq.com> Date: Sat, 15 Jun 2024 14:56:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dreply=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/update.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/apps/update.ts b/apps/update.ts index 7abe777..6462614 100644 --- a/apps/update.ts +++ b/apps/update.ts @@ -175,27 +175,28 @@ export class update extends Plugin { async updateAll() { const dirs = fs.readdirSync('./plugins/') - const originalReply = this.reply + const MSG = (message)=>{ + // 收集 + this.messages.push(message) + } const testReg = /^#静默全部(强制)?更新$/.test(this.e.msg) if (testReg) { await this.reply(`开始执行静默全部更新,请稍等...`) - this.reply = (message) => { - this.messages.push(message) - } } await this.runUpdate() - for (let plu of dirs) { - plu = this.getPlugin(plu) - if (plu === false) continue + for (const plu of dirs) { + const Plu = this.getPlugin(plu) + if (Plu === false) continue await sleep(1500) - await this.runUpdate(plu) + await this.runUpdate(Plu) } if (testReg) { - await this.reply(await makeForwardMsg(this.e, this.messages)) + const msg = await makeForwardMsg(this.e, this.messages) + MSG(msg) } if (this.isUp) { @@ -203,7 +204,6 @@ export class update extends Plugin { setTimeout(() => this.restart(), 2000) } - this.reply = originalReply } restart() {