mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-04 19:17:38 +08:00
Merge pull request #274 from icarus-ai/patch-3
genLongTemplate 非ASCII字符串长度计数错误
This commit is contained in:
commit
026b01c440
@ -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