From e1f51c81f07fd3ad142bcd84777c92ea97093dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=8F=B6?= <1936472877@qq.com> Date: Thu, 21 Nov 2024 18:09:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B2=A1=E6=9C=89=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=BB=91=E7=99=BD=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/setting.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/setting.js b/apps/setting.js index fd1b082..7911f42 100644 --- a/apps/setting.js +++ b/apps/setting.js @@ -96,7 +96,16 @@ export const rule = { await e.reply(`${id}已经在${regRet[2]}名单中了~`) } else { data.push(id) - await e.reply(`已将${id}${regRet[1]}到${regRet[2]}名单了~现在的${regRet[2]}名单是:\n ${data.join(', ') || '空'}`) + await e.reply(`已将${id}添加到${regRet[2]}名单了~现在的${regRet[2]}名单是:\n ${data.join(', ') || '空'}`) + Config.modify('push', target, data) + } + } else { + const index = data.findIndex(i => i.id == id) + if (index === -1) { + await e.reply(`${id}不在${regRet[2]}名单中~`) + } else { + data.splice(index, 1) + await e.reply(`已将${id}移出${regRet[2]}名单了~现在的${regRet[2]}名单是:\n ${data.join(', ') || '空'}`) Config.modify('push', target, data) } }