mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-23 01:36:36 +08:00
* feat:添加沙雕app一系列api * fix: 修个文案 * fix:修改等级 * fix:好孩子不能骂人 Co-authored-by: Guohuiyuan <haibaraguo@yeahka.com>
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
package shadiao
|
|
|
|
import (
|
|
"github.com/FloatTech/ZeroBot-Plugin/utils/web"
|
|
"github.com/tidwall/gjson"
|
|
zero "github.com/wdvxdr1123/ZeroBot"
|
|
"github.com/wdvxdr1123/ZeroBot/message"
|
|
"github.com/wdvxdr1123/ZeroBot/utils/helper"
|
|
)
|
|
|
|
func init() {
|
|
engine.OnFullMatch("来碗绿茶").SetBlock(true).SetPriority(prio).Handle(func(ctx *zero.Ctx) {
|
|
if !limit.Load(ctx.Event.GroupID).Acquire() {
|
|
return
|
|
}
|
|
data, err := web.ReqWith(chayiURL, "GET", loveliveReferer, ua)
|
|
if err != nil {
|
|
ctx.SendChain(message.Text("ERROR:", err))
|
|
return
|
|
}
|
|
text := gjson.Get(helper.BytesToString(data), "returnObj.content").String()
|
|
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(text))
|
|
})
|
|
|
|
engine.OnFullMatch("渣我").SetBlock(true).SetPriority(prio).Handle(func(ctx *zero.Ctx) {
|
|
if !limit.Load(ctx.Event.GroupID).Acquire() {
|
|
return
|
|
}
|
|
data, err := web.ReqWith(ganhaiURL, "GET", loveliveReferer, ua)
|
|
if err != nil {
|
|
ctx.SendChain(message.Text("ERROR:", err))
|
|
return
|
|
}
|
|
text := gjson.Get(helper.BytesToString(data), "returnObj.content").String()
|
|
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(text))
|
|
})
|
|
}
|