修改部分逻辑

This commit is contained in:
liyp 2024-04-01 11:19:52 +08:00
parent 822847adcb
commit 3846c6b4a4

View file

@ -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
}