From a74b66b1c851339efa00f1aefdedfbda2c4aeff0 Mon Sep 17 00:00:00 2001 From: yeyang <746659424@qq.com> Date: Tue, 19 Mar 2024 20:20:24 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E6=94=B6/?= =?UTF-8?q?=E5=8F=91/=E5=9B=BE=E7=89=87=E8=AE=A1=E6=95=B0fix=20#99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/state.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/state.js b/apps/state.js index b7b311f..12679fc 100644 --- a/apps/state.js +++ b/apps/state.js @@ -135,11 +135,9 @@ const getBotState = async (botList) => { const onlineStatus = status[bot.status] || '在线' const platform = bot.apk ? `${bot.apk.display} v${bot.apk.version}` : bot.version?.version || '未知' - const [sent, recv, screenshot] = await Promise.all([ - redis.get(`Yz:count:send:msg:bot:${bot.uin}:total`), - redis.get(`Yz:count:receive:msg:bot:${bot.uin}:total`) || bot.stat?.recv_msg_cnt || '未知', - redis.get(`Yz:count:send:image:bot:${bot.uin}:total`) - ]) + const sent = await redis.get(`Yz:count:send:msg:bot:${bot.uin}:total`) || await redis.get('Yz:count:sendMsg:total') + const recv = await redis.get(`Yz:count:receive:msg:bot:${bot.uin}:total`) || bot.stat?.recv_msg_cnt + const screenshot = await redis.get(`Yz:count:send:image:bot:${bot.uin}:total`) || await redis.get('Yz:count:screenshot:total') const friendQuantity = bot.fl?.size || 0 const groupQuantity = bot.gl?.size || 0 @@ -157,7 +155,7 @@ const getBotState = async (botList) => {
${onlineStatus}(${platform}) | ${botVersion}
-收${recv} | 发${sent || 0} | 图片${screenshot || 0} | 好友${friendQuantity} | 群${groupQuantity} | 群员${groupMemberQuantity}
+收${recv || 0} | 发${sent || 0} | 图片${screenshot || 0} | 好友${friendQuantity} | 群${groupQuantity} | 群员${groupMemberQuantity}
${BotName} 已运行 ${runTime} | 系统运行 ${systime}
${calendar} | Node.js ${process.version} | ${process.platform} ${process.arch}