mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-12 10:10:25 +00:00
✨ 新增插件控制
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/FloatTech/ZeroBot-Plugin/control"
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
"github.com/wdvxdr1123/ZeroBot/message"
|
||||
)
|
||||
@@ -59,7 +60,12 @@ type resultjson struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
zero.OnRegex(`^来张 (.*)$`, zero.AdminPermission).
|
||||
engine := control.Register("imgfinder", &control.Options{
|
||||
DisableOnDefault: false,
|
||||
Help: "关键字搜图\n" +
|
||||
"- 来张 [xxx]",
|
||||
})
|
||||
engine.OnRegex(`^来张 (.*)$`, zero.AdminPermission).
|
||||
Handle(func(ctx *zero.Ctx) {
|
||||
keyword := ctx.State["regex_matched"].([]string)[1]
|
||||
soutujson := soutuapi(keyword)
|
||||
|
||||
Reference in New Issue
Block a user