Merge pull request !44 from 柠檬冲水/N/A
This commit is contained in:
Kokomi 2023-10-24 09:28:33 +00:00 committed by Gitee
commit 01bd4e2309
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 14 additions and 7 deletions

View File

@ -78,19 +78,27 @@ const { changelogs, currentVersion } = readLogFile('miao')
const yunzaiVersion = packageJson.version
const isV3 = yunzaiVersion[0] === '3'
let isMiao = false
let name = "Yunzai-Bot"
let name = 'Yunzai-Bot'
let isAlemonjs = false
if (packageJson.name === 'miao-yunzai') {
isMiao = true
name = "Miao-Yunzai"
name = 'Miao-Yunzai'
} else if (packageJson.name === 'trss-yunzai') {
isMiao = true
name = "TRSS-Yunzai"
name = 'TRSS-Yunzai'
}
else if (packageJson.name === 'a-yunzai') {
isMiao = true
name = 'A-Yunzai'
isAlemonjs = true
}
let Version = {
isV3,
isMiao,
name,
isAlemonjs,
get version () {
return currentVersion
},

View File

@ -29,7 +29,7 @@ setTimeout(async function () {
let msgs = [`当前喵喵版本: ${Version.version}`, '您可使用 #喵喵版本 命令查看更新信息']
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')
}
if (!fs.existsSync(process.cwd() + '/lib/plugins/runtime.js')) {

View File

@ -2,11 +2,10 @@ import { createApps } from 'alemonjs'
import { apps } from './index.js'
const app = createApps(import.meta.url)
app.setMessage(async e => {
const data = await runtime.init(e)
e = data.e
await runtime.init(e)
e.sender = {}
e.sender.card = e.user_name
return e
})
app.component(apps)
app.mount()
app.mount()