fix: 修复插件错误和更改别名

This commit is contained in:
ningmengchongshui 2024-06-11 21:33:21 +08:00
parent f665dcf634
commit ce73f7da60
4 changed files with 10 additions and 12 deletions

View File

@ -80,7 +80,11 @@
}, },
"imports": { "imports": {
"#image/*": "./image/*", "#image/*": "./image/*",
"#miao/*": "./src/*", "#yunzai/config": "./src/config/index.js",
"#yunzai/core": "./src/core/index.js",
"#yunzai/db": "./src/db/index.js",
"#yunzai/mys": "./src/mys/index.js",
"#yunzai/utils": "./src/utils/index.js",
"#miao": "./plugins/miao-plugin/components/index.js", "#miao": "./plugins/miao-plugin/components/index.js",
"#miao.models": "./plugins/miao-plugin/models/index.js" "#miao.models": "./plugins/miao-plugin/models/index.js"
} }

View File

@ -1,4 +1,5 @@
export * from './plugins/index.js' export * from './plugins/index.js'
export * from './plugins/functional.js' export * from './plugins/functional.js'
export * from './plugins/types.js' export * from './plugins/types.js'
export * from './plugins/common.js'
export * from './icqq.js' export * from './icqq.js'

View File

@ -1,5 +1,4 @@
import { segment } from 'icqq'
import { Common } from '../../miao.js' import { Common } from '../../miao.js'
import { EventType } from './types.js' import { EventType } from './types.js'
@ -51,9 +50,7 @@ export class plugin {
/** /**
* *
*/ */
e: EventType & { e: EventType
segment: typeof segment
}
/** /**
* @param name * @param name
@ -128,9 +125,6 @@ export class plugin {
this.namespace = namespace || '' this.namespace = namespace || ''
} }
// 携带segment
this.e.segment = segment
} }
/** /**
@ -138,9 +132,8 @@ export class plugin {
* @param quote * @param quote
* @param data.recallMsg 0-1200 * @param data.recallMsg 0-1200
* @param data.at at用户 * @param data.at at用户
* @deprecated
*/ */
reply(msg = '', quote = false, data = {}) { reply(msg: any[] | string = '', quote = false, data = {}) {
if (!this.e?.reply || !msg) return false if (!this.e?.reply || !msg) return false
return this.e.reply(msg, quote, data) return this.e.reply(msg, quote, data)
} }

View File

@ -35,7 +35,7 @@
"paths": { "paths": {
// //
"#image/*": ["./image/*"], "#image/*": ["./image/*"],
"#miao/*": ["./src/*"], "#yunzai/*": ["./src/*"],
// //
"#miao": ["./plugins/miao-plugin/components/index.js"], "#miao": ["./plugins/miao-plugin/components/index.js"],
"#miao.models": ["./plugins/miao-plugin/models/index.js"] "#miao.models": ["./plugins/miao-plugin/models/index.js"]
@ -46,5 +46,5 @@
"transpileOnly": true, "transpileOnly": true,
"experimentalSpecifierResolution": "node" "experimentalSpecifierResolution": "node"
}, },
"include": ["src", "image", "plugins"] "include": ["src", "image", "plugins", "plugins/system-plugin"]
} }