This commit is contained in:
cdle
2021-10-13 09:24:36 +08:00
parent ec3eed649f
commit 071980f979
3 changed files with 6 additions and 0 deletions
+4
View File
@@ -6,6 +6,7 @@ import (
"time"
"github.com/beego/beego/v2/client/httplib"
"github.com/buger/jsonparser"
)
func init() {
@@ -21,6 +22,9 @@ func init() {
}
reply := func(str string) string {
str, _ = httplib.Get(fmt.Sprintf(api, str)).String()
if gjson := sillyGirl.Get("小爱同学gjson"); gjson != "" {
str, _ = jsonparser.GetString([]byte(str), strings.Split(gjson, ".")...)
}
if str == "" {
str = "暂时无法回复。"
}