From 24955dc4a7636cf11a6cc8a70a811325ca014ea7 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: Sat, 1 Feb 2025 16:13:43 +0800 Subject: [PATCH] fix(thesaurus): ingore empty seg --- plugin/thesaurus/chat.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/thesaurus/chat.go b/plugin/thesaurus/chat.go index 6fc9303823..ee2dc1fa4d 100644 --- a/plugin/thesaurus/chat.go +++ b/plugin/thesaurus/chat.go @@ -287,6 +287,9 @@ func randreply(m map[string][]string) zero.Handler { text = strings.ReplaceAll(text, "{me}", nick) id := ctx.Event.MessageID for _, t := range strings.Split(text, "{segment}") { + if t == "" { + continue + } process.SleepAbout1sTo2s() id = ctx.SendChain(message.Reply(id), message.Text(t)) }