mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 11:07:40 +08:00
genLongTemplate 非ASCII字符串长度计数错误
一个字切成半个啦😭
This commit is contained in:
parent
62b5678c94
commit
fc9a403abf
@ -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
|
||||||
}()
|
}()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user