mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-06 15:20:22 +00:00
✨ 新增插件控制
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user