mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-06 15:20:22 +00:00
增加沙雕app一系列接口 (#91)
* feat:添加沙雕app一系列api * fix: 修个文案 * fix:修改等级 * fix:好孩子不能骂人 Co-authored-by: Guohuiyuan <haibaraguo@yeahka.com>
This commit is contained in:
29
plugin_shadiao/zuan.go
Normal file
29
plugin_shadiao/zuan.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package shadiao
|
||||
|
||||
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(zuanURL, "GET", zuanReferer, ua)
|
||||
if err != nil {
|
||||
ctx.SendChain(message.Text("ERROR:", err))
|
||||
return
|
||||
}
|
||||
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(helper.BytesToString(data)))
|
||||
})
|
||||
engine.OnRegex(`^骂他.*?(\d+)`, zero.OnlyGroup).SetBlock(true).SetPriority(40).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
if !limit.Load(ctx.Event.GroupID).Acquire() {
|
||||
return
|
||||
}
|
||||
data, err := web.ReqWith(zuanURL, "GET", "", ua)
|
||||
if err != nil {
|
||||
ctx.SendChain(message.Text("ERROR:", err))
|
||||
return
|
||||
}
|
||||
ctx.SendChain(message.At(math.Str2Int64(ctx.State["regex_matched"].([]string)[1])), message.Text(helper.BytesToString(data)))
|
||||
})
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user