新增插件控制

This commit is contained in:
fumiama
2021-09-09 00:20:04 +08:00
parent be49ba83b3
commit 087c6c0298
21 changed files with 355 additions and 48 deletions

View File

@@ -5,14 +5,24 @@ import (
"io/ioutil"
"net/http"
"github.com/FloatTech/ZeroBot-Plugin/control"
"github.com/tidwall/gjson"
zero "github.com/wdvxdr1123/ZeroBot"
"github.com/wdvxdr1123/ZeroBot/message"
)
var engine *zero.Engine
// 查成分的
func init() {
zero.OnRegex(`^>user info\s(.{1,25})$`).
engine = control.Register("bilibili", &control.Options{
DisableOnDefault: false,
Help: "bilibili\n" +
"- >vup info [名字|uid]\n" +
"- >user info [名字|uid]\n" +
"- /开启粉丝日报",
})
engine.OnRegex(`^>user info\s(.{1,25})$`).
Handle(func(ctx *zero.Ctx) {
keyword := ctx.State["regex_matched"].([]string)[1]
rest, err := uid(keyword)