新增插件控制

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

@@ -23,7 +23,7 @@ type follower struct {
// 开启日报推送
func init() {
zero.OnFullMatch("/开启粉丝日报", zero.AdminPermission).
engine.OnFullMatch("/开启粉丝日报", zero.AdminPermission).
Handle(func(ctx *zero.Ctx) {
fansDaily(ctx.Event.GroupID) // 群号传进去给下面发信息的函数
})

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)

View File

@@ -13,7 +13,7 @@ import (
// 查vup粉丝数据
func init() {
zero.OnRegex(`^>vup info\s?(.{1,25})$`).
engine.OnRegex(`^>vup info\s?(.{1,25})$`).
Handle(func(ctx *zero.Ctx) {
keyword := ctx.State["regex_matched"].([]string)[1]
res, err := uid(keyword)