适配R插件

代码参考 @zhiyu1998 佬在 Yunzai-Bot 提交的代码 

Signed-off-by: ฅ懒喵喵吖 <2865556514@qq.com>
This commit is contained in:
ฅ懒喵喵吖 2023-05-28 14:33:58 +00:00 committed by Gitee
parent b561ab4b3b
commit e7644ea92f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 4 additions and 1 deletions

View File

@ -236,7 +236,10 @@ class PluginsLoader {
/** 判断事件 */ /** 判断事件 */
if (v.event && !this.filtEvent(e, v)) continue 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}]` e.logFnc = `[${plugin.name}][${v.fnc}]`
if (v.log !== false) { if (v.log !== false) {