From 5b0d782de8fe15a92d80ef6f77221515e21d0e3f Mon Sep 17 00:00:00 2001 From: Ctrlcvs <1509167646@qq.com> Date: Sun, 18 Sep 2022 22:09:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81V3=E6=88=B3=E4=B8=80=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adapter/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/adapter/index.js b/adapter/index.js index 1645a47..b5e9c9b 100644 --- a/adapter/index.js +++ b/adapter/index.js @@ -4,23 +4,27 @@ import { render } from './render.js' import { checkAuth, getMysApi } from './mys.js' export class atlas extends plugin { - constructor () { + constructor (e) { let rule = { reg: '.+', fnc: 'dispatch' } + let event=e?.event || e?.sub_type super({ name: 'xiaoyao-cvs-plugin', desc: '图鉴插件', - event: 'message', + event: event === 'poke' ? 'notice.*.poke' : 'message', priority: 50, - rule: [rule] + rule: [rule], }) Object.defineProperty(rule, 'log', { get: () => !!this.isDispatch }) } accept () { + if(this.event==='notice.*.poke'){ + this.e.msg = '#poke#' + } this.e.original_msg = this.e.original_msg || this.e.msg } async dispatch (e) {