From 1eda0471bfc3bfae7b470d081ae5f1c6ce792182 Mon Sep 17 00:00:00 2001 From: Suika <290760339@qq.com> Date: Thu, 1 Jul 2021 20:43:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E7=BC=BA=E5=A4=B1=E7=9A=84=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=92=8C=E7=BB=93=E6=9E=84=E4=BD=93=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 我也太铸币了吧呜呜呜 --- plugin_diana/fansDaily.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/plugin_diana/fansDaily.go b/plugin_diana/fansDaily.go index 087071f3..86c9cc6f 100644 --- a/plugin_diana/fansDaily.go +++ b/plugin_diana/fansDaily.go @@ -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). @@ -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 +}