From 983b882b9007a95d5732c75b54f0f48f98f04d00 Mon Sep 17 00:00:00 2001 From: Vaica <94612053+zqlit@users.noreply.github.com> Date: Wed, 24 Jun 2026 16:18:13 +0800 Subject: [PATCH] Update handlers.ts --- write-server/src/lib/bot/handlers.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/write-server/src/lib/bot/handlers.ts b/write-server/src/lib/bot/handlers.ts index 164e0159..0785faac 100644 --- a/write-server/src/lib/bot/handlers.ts +++ b/write-server/src/lib/bot/handlers.ts @@ -3,7 +3,7 @@ import { getLinks, addLink, updateLink, deleteLink, getFeeds, addFeed, updateFee import { moveToRecycle } from "@/lib/recycle"; import { deployQueue } from "@/lib/git"; import { hugo } from "@/lib/hugo"; -import { getLanIP, DEFAULT_AUTHOR } from "@/lib/config"; +import { getLanIP, DEFAULT_AUTHOR, BLOG_ROOT } from "@/lib/config"; import { sendMessage, tg } from "./tg"; import { getSession, hasSession, clearSession, saveSession, undoLastChunk, initSessionDir } from "./sessions"; import { makeSlug, sessionSummary, truncateText } from "./helpers"; @@ -671,13 +671,13 @@ handlers.read = async (chatId) => { handlers.stats = async (chatId) => { try { - const res = await fetch(BLOG_ROOT + "/index.xml"); - const data = await getStats(); + const posts = await listPosts({ page: 1, perPage: 10000 }); const lines = ["📊 网站数据\n"]; - lines.push("📝 文章总数:" + data.totalPosts + " 篇"); - lines.push("💬 评论总数:" + data.totalComments + " 条"); + lines.push("📝 文章总数:" + posts.total + " 篇"); + lines.push("🌐 访问地址:https://post.usj.cc"); await sendMain(chatId, lines.join("\n")); } catch (e) { await sendMain(chatId, "⚠️ 获取失败,请稍后再试"); } }; export default handlers; + \ No newline at end of file