Skip to content
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_score" // 分数
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_shadiao" // 沙雕app
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_shindan" // 测定

_ "github.com/FloatTech/ZeroBot-Plugin/plugin_wangyiyun" // 网易云音乐热评
// b站相关
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili" // 查询b站用户信息
// _ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili_push" // b站推送
Expand Down
30 changes: 30 additions & 0 deletions plugin_wangyiyun/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package wangyiyun

import
(

zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
"github.com/wdvxdr1123/ZeroBot/utils/helper"

"github.com/FloatTech/zbputils/web"

)
const(
wangyiyunURL = "http://ovooa.com/API/wyrp/api.php?type=text"
wangyiyunReferer = "http://ovooa.com/"
ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"
)
func init() {
engine.OnFullMatch("来份网易云热评").SetBlock(true).Handle(func(ctx *zero.Ctx) {
Comment thread
fumiama marked this conversation as resolved.
Outdated
if !limit.Load(ctx.Event.GroupID).Acquire() {
return
}
data, err := web.ReqWith(wangyiyunURL, "GET", wangyiyunReferer, ua)
if err != nil {
ctx.SendChain(message.Text("ERROR:", err))
return
}
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(helper.BytesToString(data)))
Comment thread
fumiama marked this conversation as resolved.
Outdated
})
}