mirror of
https://github.com/ctrlcvs/xiaoyao-cvs-plugin.git
synced 2024-12-22 19:10:53 +08:00
支持V3戳一戳
This commit is contained in:
parent
39341ed59a
commit
5b0d782de8
@ -4,23 +4,27 @@ import { render } from './render.js'
|
|||||||
import { checkAuth, getMysApi } from './mys.js'
|
import { checkAuth, getMysApi } from './mys.js'
|
||||||
|
|
||||||
export class atlas extends plugin {
|
export class atlas extends plugin {
|
||||||
constructor () {
|
constructor (e) {
|
||||||
let rule = {
|
let rule = {
|
||||||
reg: '.+',
|
reg: '.+',
|
||||||
fnc: 'dispatch'
|
fnc: 'dispatch'
|
||||||
}
|
}
|
||||||
|
let event=e?.event || e?.sub_type
|
||||||
super({
|
super({
|
||||||
name: 'xiaoyao-cvs-plugin',
|
name: 'xiaoyao-cvs-plugin',
|
||||||
desc: '图鉴插件',
|
desc: '图鉴插件',
|
||||||
event: 'message',
|
event: event === 'poke' ? 'notice.*.poke' : 'message',
|
||||||
priority: 50,
|
priority: 50,
|
||||||
rule: [rule]
|
rule: [rule],
|
||||||
})
|
})
|
||||||
Object.defineProperty(rule, 'log', {
|
Object.defineProperty(rule, 'log', {
|
||||||
get: () => !!this.isDispatch
|
get: () => !!this.isDispatch
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
accept () {
|
accept () {
|
||||||
|
if(this.event==='notice.*.poke'){
|
||||||
|
this.e.msg = '#poke#'
|
||||||
|
}
|
||||||
this.e.original_msg = this.e.original_msg || this.e.msg
|
this.e.original_msg = this.e.original_msg || this.e.msg
|
||||||
}
|
}
|
||||||
async dispatch (e) {
|
async dispatch (e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user