From e7644ea92f625f6fc57a9949118e3712425e89aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B8=85=E6=87=92=E5=96=B5=E5=96=B5=E5=90=96?= <2865556514@qq.com> Date: Sun, 28 May 2023 14:33:58 +0000 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8DR=E6=8F=92=E4=BB=B6=20?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=8F=82=E8=80=83=20@zhiyu1998=20=E4=BD=AC?= =?UTF-8?q?=E5=9C=A8=20Yunzai-Bot=20=E6=8F=90=E4=BA=A4=E7=9A=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ฅ懒喵喵吖 <2865556514@qq.com> --- lib/plugins/loader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/plugins/loader.js b/lib/plugins/loader.js index c620194..c993fbc 100644 --- a/lib/plugins/loader.js +++ b/lib/plugins/loader.js @@ -236,7 +236,10 @@ class PluginsLoader { /** 判断事件 */ if (v.event && !this.filtEvent(e, v)) continue - if (new RegExp(v.reg).test(e.msg)) { + const regExp = new RegExp(v.reg); + /** 匹配消息或者小程序 */ + const messageOrApplet = e.msg || e.message?.[0]?.data; + if (regExp.test(messageOrApplet)) { e.logFnc = `[${plugin.name}][${v.fnc}]` if (v.log !== false) {