🐛 修复状态无e.bot.avatar报错

This commit is contained in:
yeyang
2023-04-29 14:35:12 +08:00
parent 3a9f39efe2
commit 12f3c11c52

View File

@@ -57,7 +57,7 @@ export class NewState extends plugin {
let data = {
chartData: JSON.stringify(_.every(_.omit(State.chartData, 'echarts_theme'), _.isEmpty) ? undefined : State.chartData),
// 头像
portrait: e.bot.avatar || `https://q1.qlogo.cn/g?b=qq&s=0&nk=${(e.bot ?? Bot).uin}`,
portrait: e.bot?.avatar ?? `https://q1.qlogo.cn/g?b=qq&s=0&nk=${(e.bot ?? Bot).uin}`,
// 运行时间
runTime: common.formatTime(Date.now() / 1000 - (e.bot ?? Bot).stat.start_time, 'dd天hh小时mm分ss', false),
// 日历