From c86986edfe97e912b69870a07d3b329399698dd6 Mon Sep 17 00:00:00 2001 From: zolay Date: Mon, 19 Feb 2024 03:08:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E7=A7=81=E8=81=8A=E9=80=9A=E8=A1=8C?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=E8=AE=BE=E4=B8=BAnull=E6=88=96?= =?UTF-8?q?=E7=A9=BA=E6=95=B0=E7=BB=84=E6=97=B6=E7=A6=81=E7=94=A8=E7=A7=81?= =?UTF-8?q?=E8=81=8A=E5=A4=B1=E6=95=88=20fixed=20#371=20(#372)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/system/disablePrivate.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/system/disablePrivate.js b/plugins/system/disablePrivate.js index b029557..c88b93e 100644 --- a/plugins/system/disablePrivate.js +++ b/plugins/system/disablePrivate.js @@ -29,9 +29,14 @@ export class disPri extends plugin { /** 绑定ck,抽卡链接 */ let wordReg = /(.*)(ltoken|_MHYUUID|authkey=)(.*)|导出记录(json)*|(记录|安卓|苹果|ck|cookie|体力)帮助|^帮助$|^#*(删除|我的)ck$|^#(我的)?(uid|UID)[0-9]{0,2}$/g /** 自定义通行字符 */ - let disableReg = `(.*)(${cfg.other?.disableAdopt?.join('|')})(.*)` + let disableAdopt = cfg.other?.disableAdopt + if (!Array.isArray(disableAdopt)) { + disableAdopt = [] + } + disableAdopt = disableAdopt.filter(str => str != null && str !== ''); + let disableReg = `(.*)(${disableAdopt.join('|')})(.*)` if (this.e.raw_message) { - if (!new RegExp(wordReg).test(this.e.raw_message) && (!new RegExp(disableReg).test(this.e.raw_message))) { + if (!new RegExp(wordReg).test(this.e.raw_message) && (disableAdopt.length === 0 || !new RegExp(disableReg).test(this.e.raw_message))) { this.sendTips() return 'return' }