🔥 🎨 优化代码结构

This commit is contained in:
fumiama
2022-02-09 15:43:14 +08:00
parent 806b77acce
commit 8c943d2c01
77 changed files with 333 additions and 404 deletions

View File

@@ -16,7 +16,7 @@ import (
"github.com/wdvxdr1123/ZeroBot/message"
"github.com/wdvxdr1123/ZeroBot/utils/helper"
"github.com/FloatTech/ZeroBot-Plugin/order"
"github.com/FloatTech/zbputils/control/order"
)
const cachefile = "data/danbooru/"
@@ -27,13 +27,13 @@ func init() { // 插件主体
if err != nil {
panic(err)
}
engine := control.Register("danbooru", order.PrioDanbooru, &control.Options{
engine := control.Register("danbooru", order.AcquirePrio(), &control.Options{
DisableOnDefault: false,
Help: "二次元图片标签识别\n" +
"- 鉴赏图片[图片]",
})
// 上传一张图进行评价
engine.OnKeywordGroup([]string{"鉴赏图片"}, zero.OnlyGroup, ctxext.CmdMatch, ctxext.MustGiven).SetBlock(true).
engine.OnKeywordGroup([]string{"鉴赏图片"}, zero.OnlyGroup, ctxext.MustProvidePicture).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
ctx.SendChain(message.Text("少女祈祷中..."))
for _, url := range ctx.State["image_url"].([]string) {