Skip to content

Commit

Permalink
把缺失的函数和结构体声明加上
Browse files Browse the repository at this point in the history
我也太铸币了吧呜呜呜
  • Loading branch information
Suika99 authored Jul 1, 2021
1 parent f827b55 commit 1eda047
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions plugin_diana/fansDaily.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ import (
"github.com/wdvxdr1123/ZeroBot/message"
)

type follower struct {
Mid int `json:"mid"`
Uname string `json:"uname"`
Video int `json:"video"`
Roomid int `json:"roomid"`
Rise int `json:"rise"`
Follower int `json:"follower"`
GuardNum int `json:"guardNum"`
AreaRank int `json:"areaRank"`
}


// 开启日报推送
func init() {
zero.OnFullMatch("/开启粉丝日报", zero.AdminPermission).
Expand Down Expand Up @@ -88,3 +100,19 @@ func fansData(groupID int64) {
return true
})
}

// 请求api
func fensiapi(uid string) *follower {

url := "https://api.vtbs.moe/v1/detail/" + uid
resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
result := &follower{}
if err := json.NewDecoder(resp.Body).Decode(result); err != nil {
panic(err)
}
return result
}

0 comments on commit 1eda047

Please sign in to comment.