From fc9a403abf10e1d55f25751d681edd122c707a0e Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Tue, 17 May 2022 16:08:17 +0800 Subject: [PATCH] =?UTF-8?q?genLongTemplate=20=E9=9D=9EASCII=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=E9=95=BF=E5=BA=A6=E8=AE=A1=E6=95=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 一个字切成半个啦😭 --- client/global.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/global.go b/client/global.go index ca623397..6d10b5c1 100644 --- a/client/global.go +++ b/client/global.go @@ -307,8 +307,8 @@ func genForwardTemplate(resID, preview, summary string, ts int64, items []*msg.P func genLongTemplate(resID, brief string, ts int64) *message.ServiceElement { limited := func() string { - if len(brief) > 30 { - return brief[:30] + "…" + if ss := []rune(brief); len(ss) > 30 { + return string(ss[:30]) + "…" } return brief }()