From e9f145056d8c65f87548dff14fc06d9cd3fac029 Mon Sep 17 00:00:00 2001 From: fumiama Date: Tue, 23 Nov 2021 22:51:18 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20=E5=B0=8F=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin_wtf/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin_wtf/main.go b/plugin_wtf/main.go index ae64e9e9..0855895b 100644 --- a/plugin_wtf/main.go +++ b/plugin_wtf/main.go @@ -45,11 +45,11 @@ func init() { return } // 获取名字 - name := ctx.State["args"].(string) + var name string if len(ctx.Event.Message) > 1 && ctx.Event.Message[1].Type == "at" { qq, _ := strconv.ParseInt(ctx.Event.Message[1].Data["qq"], 10, 64) name = ctx.GetGroupMemberInfo(ctx.Event.GroupID, qq, false).Get("nickname").Str - } else if name == "" { + } else { name = ctx.Event.Sender.NickName } text, err := w.Predict(name)