From 7616d5759f304253c9728a1c7d0a190b39ee84e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Fri, 28 Oct 2022 11:40:58 +0800 Subject: [PATCH] =?UTF-8?q?fix=20nsetu=20=E5=BE=AA=E7=8E=AF=E8=A7=A6?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/nativesetu/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin/nativesetu/main.go b/plugin/nativesetu/main.go index c7787e05..5e4b8086 100644 --- a/plugin/nativesetu/main.go +++ b/plugin/nativesetu/main.go @@ -95,7 +95,8 @@ func init() { }) engine.OnFullMatch("所有本地setu分类").SetBlock(true). Handle(func(ctx *zero.Ctx) { - msg := "所有本地setu分类" + msg := "本地setu分类一览" + hasnotchange := true ns.mu.RLock() for i, c := range ns.List() { n, err := ns.db.Count(c) @@ -105,8 +106,12 @@ func init() { msg += fmt.Sprintf("\n%02d. %s(error)", i, c) logrus.Errorln("[nsetu]", err) } + hasnotchange = false } ns.mu.RUnlock() + if hasnotchange { + msg += "\n空" + } ctx.SendChain(message.Text(msg)) }) }