!21 #椰奶状态 将会获取bot名称

Merge pull request !21 from 曉K/master
This commit is contained in:
曉K
2023-08-01 21:35:03 +00:00
committed by 椰羊
parent ea0a6fe747
commit 4a2e19670a
4 changed files with 7 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
import plugin from '../../../lib/plugins/plugin.js'
import os from 'os'
import { Config } from '../components/index.js'
import { Config, Version } from '../components/index.js'
import { State, common, puppeteer } from '../model/index.js'
import { platform, status } from '../constants/other.js'
import moment from 'moment'
@@ -85,6 +85,8 @@ export class NewState extends plugin {
chartData: JSON.stringify(common.checkIfEmpty(State.chartData, ['echarts_theme', 'cpu', 'ram']) ? undefined : State.chartData),
// 头像
portrait: e.bot?.avatar ?? `https://q1.qlogo.cn/g?b=qq&s=0&nk=${this.Bot.uin}`,
// 机器人名称
BotName: Version.name,
// 运行时间
runTime: common.formatTime(Date.now() / 1000 - this.Bot.stat?.start_time, 'dd天hh小时mm分', false),
// 日历

View File

@@ -1,4 +1,3 @@
import fs from 'fs'
import _ from 'lodash'
import cfg from '../../../lib/config/config.js'
@@ -92,6 +91,8 @@ if (yunzaiName == 'miao-yunzai') {
yunzaiName = 'Miao-Yunzai'
} else if (yunzaiName == 'yunzai') {
yunzaiName = 'Yunzai-Bot'
} else if (yunzaiName == 'trss-yunzai') {
yunzaiName = 'TRSS-Yunzai'
} else {
yunzaiName = _.capitalize(yunzaiName)
}

View File

@@ -35,7 +35,7 @@ export const platform = {
3: 'android_Watch',
4: 'macOS',
5: 'iPad',
6: 'old_Android'
6: 'Tim'
}
/** 在线状态 */

View File

@@ -17,7 +17,7 @@
<p>{{status}}({{platform}}) | 收{{recv}} | 发{{sent}} | 图片{{screenshot}} | 好友{{friendQuantity}} |
群{{groupQuantity}}
</p>
<p>Yunzai-Bot 已运行 {{runTime}} | 系统运行 {{systime}}</p>
<p>{{BotName}} 已运行 {{runTime}} | 系统运行 {{systime}}</p>
<p>{{calendar}} | Nodejs {{nodeVersion}} | {{osPlatform}}</p>
</div>
</div>