From 49bba65245057f10cf398f67c164a90c23ae32ec Mon Sep 17 00:00:00 2001 From: cdle <798731886@qq.com> Date: Tue, 12 Oct 2021 10:34:33 +0800 Subject: [PATCH] update --- core/test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/test.go b/core/test.go index 6ab1aae..4915312 100644 --- a/core/test.go +++ b/core/test.go @@ -288,16 +288,15 @@ Alias=sillyGirl.service` stop = true return "不要走决战到天亮,啊哦~" } - if strings.Contains(ct, "我认输") { + if strings.Contains(ct, "认输") { stop = true return "菜*,见一次虐一次!" } - cy := regexp.MustCompile("^[一-龥]{4}$").FindString(ct) + cy := regexp.MustCompile("^[一-龥]+$").FindString(ct) if cy == "" { s2.Disappear(time.Millisecond * 500) return "请认真接龙,一站到底!" } - data, err := httplib.Get("http://hm.suol.cc/API/cyjl.php?id=" + id + "&msg=我接" + cy).String() if err != nil { s2.Reply(err) @@ -309,6 +308,12 @@ Alias=sillyGirl.service` } if strings.Contains(data, "你赢了") { stop = true + } else { + defer func() { + if regexp.MustCompile("^[一-龥]{4}$").FindString(ct) == "" { + s2.Reply("玩不过就认输呗。", time.Duration(time.Second)) + } + }() } return data }, `[\s\S]*`, time.Duration(time.Second*300))