mirror of
https://github.com/yoimiya-kokomi/miao-plugin.git
synced 2024-11-21 22:48:13 +00:00
创建A-Yunzai识别并修复嵌套runtime
Signed-off-by: 柠檬冲水 <10424920+ningmengchongshui@user.noreply.gitee.com>
This commit is contained in:
parent
185da994f5
commit
66b1593e43
@ -78,19 +78,27 @@ const { changelogs, currentVersion } = readLogFile('miao')
|
|||||||
const yunzaiVersion = packageJson.version
|
const yunzaiVersion = packageJson.version
|
||||||
const isV3 = yunzaiVersion[0] === '3'
|
const isV3 = yunzaiVersion[0] === '3'
|
||||||
let isMiao = false
|
let isMiao = false
|
||||||
let name = "Yunzai-Bot"
|
let name = 'Yunzai-Bot'
|
||||||
|
let isAlemonjs = false
|
||||||
if (packageJson.name === 'miao-yunzai') {
|
if (packageJson.name === 'miao-yunzai') {
|
||||||
isMiao = true
|
isMiao = true
|
||||||
name = "Miao-Yunzai"
|
name = 'Miao-Yunzai'
|
||||||
} else if (packageJson.name === 'trss-yunzai') {
|
} else if (packageJson.name === 'trss-yunzai') {
|
||||||
isMiao = true
|
isMiao = true
|
||||||
name = "TRSS-Yunzai"
|
name = 'TRSS-Yunzai'
|
||||||
|
}
|
||||||
|
else if (packageJson.name === 'a-yunzai') {
|
||||||
|
isMiao = true
|
||||||
|
name = 'A-Yunzai'
|
||||||
|
isAlemonjs = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let Version = {
|
let Version = {
|
||||||
isV3,
|
isV3,
|
||||||
isMiao,
|
isMiao,
|
||||||
name,
|
name,
|
||||||
|
isAlemonjs,
|
||||||
get version () {
|
get version () {
|
||||||
return currentVersion
|
return currentVersion
|
||||||
},
|
},
|
||||||
|
2
index.js
2
index.js
@ -29,7 +29,7 @@ setTimeout(async function () {
|
|||||||
let msgs = [`当前喵喵版本: ${Version.version}`, '您可使用 #喵喵版本 命令查看更新信息']
|
let msgs = [`当前喵喵版本: ${Version.version}`, '您可使用 #喵喵版本 命令查看更新信息']
|
||||||
await relpyPrivate(msg.qq, msgs.join('\n'))
|
await relpyPrivate(msg.qq, msgs.join('\n'))
|
||||||
}
|
}
|
||||||
if (!Version.isV3) {
|
if (!Version.isV3 && !Version.isAlemonjs) {
|
||||||
console.log('警告:miao-plugin需要V3 Yunzai,请升级至最新版Miao-Yunzai以使用miao-plugin')
|
console.log('警告:miao-plugin需要V3 Yunzai,请升级至最新版Miao-Yunzai以使用miao-plugin')
|
||||||
}
|
}
|
||||||
if (!fs.existsSync(process.cwd() + '/lib/plugins/runtime.js')) {
|
if (!fs.existsSync(process.cwd() + '/lib/plugins/runtime.js')) {
|
||||||
|
5
main.js
5
main.js
@ -2,11 +2,10 @@ import { createApps } from 'alemonjs'
|
|||||||
import { apps } from './index.js'
|
import { apps } from './index.js'
|
||||||
const app = createApps(import.meta.url)
|
const app = createApps(import.meta.url)
|
||||||
app.setMessage(async e => {
|
app.setMessage(async e => {
|
||||||
const data = await runtime.init(e)
|
await runtime.init(e)
|
||||||
e = data.e
|
|
||||||
e.sender = {}
|
e.sender = {}
|
||||||
e.sender.card = e.user_name
|
e.sender.card = e.user_name
|
||||||
return e
|
return e
|
||||||
})
|
})
|
||||||
app.component(apps)
|
app.component(apps)
|
||||||
app.mount()
|
app.mount()
|
Loading…
Reference in New Issue
Block a user