From 3846c6b4a446a05782ef7e0f3de2830988e25ff1 Mon Sep 17 00:00:00 2001 From: liyp Date: Mon, 1 Apr 2024 11:19:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- workers/core.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/workers/core.go b/workers/core.go index 3d72533..bcc4a32 100644 --- a/workers/core.go +++ b/workers/core.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "go-bot/config" - "io" "net/http" ) @@ -67,17 +66,21 @@ func contains(slice []string, value string) bool { } func (s *StdAns) GetMsg() string { - if s.Parms[0] != "" { - return "咱也不知道 " + s.Parms[0] + "是啥呢!" - } else { + // 暂时设置权限校验不通过什么都不提示 + return "-1" + // if s.Parms[0] != "" { + // return "咱也不知道 " + s.Parms[0] + "是啥呢!" + // } else { - return "汝再调戏咱,咱可就生气了!!" - } + // return "汝再调戏咱,咱可就生气了!!" + // } } func (s *StdAns) SendMsg(msg string) bool { - + if msg == "-1" { + return false + } requestBody, err := json.Marshal(map[string]interface{}{ "action": "send_msg", "params": map[string]interface{}{ @@ -105,7 +108,7 @@ func (s *StdAns) SendMsg(msg string) bool { return false } defer resp.Body.Close() - res, _ := io.ReadAll(resp.Body) - fmt.Println("响应返回:", string(res)) + // res, _ := io.ReadAll(resp.Body) + // fmt.Println("响应返回:", string(res)) return true }