1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-07-06 14:23:25 +00:00

Merge pull request #274 from icarus-ai/patch-3

genLongTemplate 非ASCII字符串长度计数错误
This commit is contained in:
Mrs4s
2022-05-17 16:48:22 +08:00
committed by GitHub

View File

@ -307,8 +307,8 @@ func genForwardTemplate(resID, preview, summary string, ts int64, items []*msg.P
func genLongTemplate(resID, brief string, ts int64) *message.ServiceElement { func genLongTemplate(resID, brief string, ts int64) *message.ServiceElement {
limited := func() string { limited := func() string {
if len(brief) > 30 { if ss := []rune(brief); len(ss) > 30 {
return brief[:30] + "…" return string(ss[:30]) + "…"
} }
return brief return brief
}() }()