From b6ff8865a39bca33a28d56f4f4cdaa36e1745ea3 Mon Sep 17 00:00:00 2001 From: Yiwen-Chan Date: Sun, 18 Apr 2021 23:04:53 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E4=BD=BF=E7=94=A8=E6=98=B5=E7=A7=B0=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E5=9B=9E=E5=A4=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shindan/shindan.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shindan/shindan.go b/shindan/shindan.go index 528f25f5..f1f776b2 100644 --- a/shindan/shindan.go +++ b/shindan/shindan.go @@ -75,8 +75,6 @@ func GetName() func(ctx *zero.Ctx) bool { qq = ctx.Event.UserID case arr[0].Type == "at": qq, _ = strconv.ParseInt(arr[0].Data["qq"], 10, 64) - default: - return false } // 获取名字 info := ctx.GetGroupMemberInfo(ctx.Event.GroupID, qq, false) @@ -89,9 +87,9 @@ func GetName() func(ctx *zero.Ctx) bool { name = info.Get("title").Str } temp := []rune(name) - if len(temp) > 10 { + if len(temp) > 20 { // 防止超长名字 - temp = temp[:10] + temp = temp[:20] } name = string(temp) ctx.State["name"] = name