From 7eaac7a20b86435a386ccb178e68348179f861a9 Mon Sep 17 00:00:00 2001 From: fumiama Date: Thu, 16 Dec 2021 16:27:25 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20fix=20gist=20panic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin_manager/manager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin_manager/manager.go b/plugin_manager/manager.go index d146e831..2836b606 100644 --- a/plugin_manager/manager.go +++ b/plugin_manager/manager.go @@ -505,6 +505,10 @@ func init() { // 插件主体 // gist 内容是当前 uinx 时间戳,在 10 分钟内视为有效 ans := ctx.Event.Comment[strings.Index(ctx.Event.Comment, "答案:")+len("答案:"):] divi := strings.Index(ans, "/") + if divi <= 0 { + ctx.SetGroupAddRequest(ctx.Event.Flag, "add", false, "格式错误!") + return + } ghun := ans[:divi] hash := ans[divi+1:] logrus.Infoln("[manager]收到加群申请, 用户:", ghun, ", hash:", hash)