mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
Update nbnhhsh.go
This commit is contained in:
parent
c724be743d
commit
83199cf3aa
@ -23,9 +23,11 @@ func init() {
|
||||
func getValue(text string) []string {
|
||||
urlValues := url.Values{}
|
||||
urlValues.Add("text", text)
|
||||
resp, _ := http.PostForm("https://lab.magiconch.com/api/nbnhhsh/guess", urlValues)
|
||||
body, _ := ioutil.ReadAll(resp.Body)
|
||||
resp.Close()
|
||||
resp, err := http.PostForm("https://lab.magiconch.com/api/nbnhhsh/guess", urlValues)
|
||||
if err == nil {
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err == nil {
|
||||
resp.Body.Close()
|
||||
json := gjson.ParseBytes(body)
|
||||
res := make([]string, 0)
|
||||
var jsonPath string
|
||||
@ -38,4 +40,8 @@ func getValue(text string) []string {
|
||||
res = append(res, value.String())
|
||||
}
|
||||
return res
|
||||
}
|
||||
return []string{err.Error()}
|
||||
}
|
||||
return []string{err.Error()}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user