mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 22:00:11 +08:00
🎨 ⚡️ 🔥 modify wyy
This commit is contained in:
parent
6990819d5c
commit
7109e30d93
@ -252,12 +252,14 @@ zerobot [-h] [-t token] [-u url] [-n nickname] [-p prefix] [-d|w] [-g 监听地
|
|||||||
- **骂人** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_curse"`
|
- **骂人** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_curse"`
|
||||||
- [x] 骂我
|
- [x] 骂我
|
||||||
- [x] 大力骂我
|
- [x] 大力骂我
|
||||||
- **b站推送** `_ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili_push"`
|
- **b站推送** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili_push"`
|
||||||
- [x] 添加订阅[uid]
|
- [x] 添加订阅[uid]
|
||||||
- [x] 取消订阅[uid]
|
- [x] 取消订阅[uid]
|
||||||
- [x] 取消动态订阅[uid]
|
- [x] 取消动态订阅[uid]
|
||||||
- [x] 取消直播订阅[uid]
|
- [x] 取消直播订阅[uid]
|
||||||
- [x] 推送列表
|
- [x] 推送列表
|
||||||
|
- **网易云音乐热评** `import _ "github.com/FloatTech/ZeroBot-Plugin/plugin_wangyiyun"`
|
||||||
|
- [x] 来份网易云热评
|
||||||
- **TODO...**
|
- **TODO...**
|
||||||
|
|
||||||
## 使用方法
|
## 使用方法
|
||||||
|
|||||||
1
main.go
1
main.go
@ -52,6 +52,7 @@ import (
|
|||||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_score" // 分数
|
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_score" // 分数
|
||||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_shadiao" // 沙雕app
|
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_shadiao" // 沙雕app
|
||||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_shindan" // 测定
|
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_shindan" // 测定
|
||||||
|
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_wangyiyun" // 网易云音乐热评
|
||||||
|
|
||||||
// b站相关
|
// b站相关
|
||||||
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili" // 查询b站用户信息
|
_ "github.com/FloatTech/ZeroBot-Plugin/plugin_bilibili" // 查询b站用户信息
|
||||||
|
|||||||
@ -1,15 +1,17 @@
|
|||||||
|
// Package wangyiyun 网易云音乐热评
|
||||||
package wangyiyun
|
package wangyiyun
|
||||||
|
|
||||||
import
|
import (
|
||||||
(
|
|
||||||
|
|
||||||
zero "github.com/wdvxdr1123/ZeroBot"
|
|
||||||
"github.com/wdvxdr1123/ZeroBot/message"
|
|
||||||
control "github.com/FloatTech/zbputils/control"
|
|
||||||
"github.com/FloatTech/zbputils/web"
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/order"
|
|
||||||
"github.com/wdvxdr1123/ZeroBot/extension/rate"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/FloatTech/zbputils/control"
|
||||||
|
"github.com/FloatTech/zbputils/web"
|
||||||
|
zero "github.com/wdvxdr1123/ZeroBot"
|
||||||
|
"github.com/wdvxdr1123/ZeroBot/extension/rate"
|
||||||
|
"github.com/wdvxdr1123/ZeroBot/message"
|
||||||
|
"github.com/wdvxdr1123/ZeroBot/utils/helper"
|
||||||
|
|
||||||
|
"github.com/FloatTech/ZeroBot-Plugin/order"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -18,26 +20,21 @@ const(
|
|||||||
ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"
|
ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"
|
||||||
)
|
)
|
||||||
|
|
||||||
var(
|
func init() {
|
||||||
engine = control.Register("wangyiyun",order.PrioWangYiYun, &control.Options{
|
limit := rate.NewManager(time.Minute, 60)
|
||||||
|
control.Register("wangyiyun", order.PrioWangYiYun, &control.Options{
|
||||||
DisableOnDefault: false,
|
DisableOnDefault: false,
|
||||||
Help: "wangyiyun \n- 来份网易云热评",
|
Help: "wangyiyun \n- 来份网易云热评",
|
||||||
})
|
}).OnFullMatch("来份网易云热评").SetBlock(true).
|
||||||
limit = rate.NewManager(time.Minute, 60)
|
|
||||||
)
|
|
||||||
func init() {
|
|
||||||
engine.OnFullMatch("来份网易云热评").SetBlock(true).
|
|
||||||
Handle(func(ctx *zero.Ctx) {
|
Handle(func(ctx *zero.Ctx) {
|
||||||
if !limit.Load(ctx.Event.GroupID).Acquire() {
|
if !limit.Load(ctx.Event.GroupID).Acquire() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data, err := web.ReqWith(wangyiyunURL, "GET", wangyiyunReferer, ua)
|
data, err := web.ReqWith(wangyiyunURL, "GET", wangyiyunReferer, ua)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.SendChain(message.Text("ERROR:", err))
|
ctx.SendChain(message.Text("ERROR:", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ctx.SendChain(message.Text(helper.BytesToString(data)))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user