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 = "暂时无法回复。"
}
+1
View File
@@ -14,6 +14,7 @@ require (
github.com/boltdb/bolt v1.3.1
github.com/buger/jsonparser v1.1.1
github.com/gin-gonic/gin v1.7.0
github.com/gorilla/websocket v1.4.2
github.com/guonaihong/gout v0.2.7 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible
+1
View File
@@ -123,6 +123,7 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/guonaihong/gout v0.2.1/go.mod h1:JkjNv1G2oRWvFgP/r4DUbYhoeIBB0zMP2j1ID+5CYpU=