fix: 聊天记录适配TRSS+chronocat

This commit is contained in:
ikechan8370 2023-10-13 22:57:16 +08:00
parent dce7503c41
commit 95e730f250
3 changed files with 47 additions and 9 deletions

33
utils/version.js Normal file
View file

@ -0,0 +1,33 @@
import fs from 'fs'
/**
* from miao-plugin
*
* @type {any}
*/
let packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8'))
const yunzaiVersion = packageJson.version
const isV3 = yunzaiVersion[0] === '3'
let isMiao = false; let isTrss = false
let name = 'Yunzai-Bot'
if (packageJson.name === 'miao-yunzai') {
isMiao = true
name = 'Miao-Yunzai'
} else if (packageJson.name === 'trss-yunzai') {
isMiao = true
isTrss = true
name = 'TRSS-Yunzai'
}
let Version = {
isV3,
isMiao,
isTrss,
name,
get yunzai () {
return yunzaiVersion
}
}
export default Version