Skip to content

Commit

Permalink
fix nsetu 循环触发
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Oct 28, 2022
1 parent ea2c81a commit 7616d57
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/nativesetu/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
})
}

0 comments on commit 7616d57

Please sign in to comment.