chore: add error log for reading chat response buffer

This commit is contained in:
RockYang
2023-07-24 12:05:38 +08:00
parent 94d8d8a9d4
commit 4d6444ebf3
8 changed files with 38 additions and 28 deletions

View File

@@ -2,6 +2,7 @@ package function
import (
"chatplus/utils"
"errors"
"fmt"
"strings"
)
@@ -28,6 +29,9 @@ type WeiBoVo struct {
}
func (f FuncWeiboHot) Invoke(...interface{}) (string, error) {
if f.token == "" {
return "", errors.New("无效的 API Token")
}
url := fmt.Sprintf("%s?num=10&token=%s", f.apiURL, f.token)
bytes, err := utils.HttpGet(url, "")