💫 ♻️ 🎉 ️ 强制使用优先级

This commit is contained in:
fumiama
2022-01-15 20:14:34 +08:00
parent 925e6847f3
commit 4519dd5eb8
58 changed files with 303 additions and 215 deletions

View File

@@ -12,6 +12,7 @@ import (
"github.com/wdvxdr1123/ZeroBot/message"
"github.com/wdvxdr1123/ZeroBot/utils/helper"
"github.com/FloatTech/ZeroBot-Plugin/order"
control "github.com/FloatTech/zbputils/control"
"github.com/FloatTech/zbputils/txt2img"
)
@@ -21,7 +22,7 @@ const (
)
var (
engine = control.Register("omikuji", &control.Options{
engine = control.Register("omikuji", order.PrioOmikuji, &control.Options{
DisableOnDefault: false,
Help: "浅草寺求签\n" +
"- 求签|占卜\n- 解签",
@@ -29,7 +30,7 @@ var (
)
func init() { // 插件主体
engine.OnFullMatchGroup([]string{"求签", "占卜"}).SetPriority(10).SetBlock(true).
engine.OnFullMatchGroup([]string{"求签", "占卜"}).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
miku := bangoToday(ctx.Event.UserID)
ctx.SendChain(
@@ -38,7 +39,7 @@ func init() { // 插件主体
message.Image(fmt.Sprintf(bed, miku, 1)),
)
})
engine.OnFullMatchGroup([]string{"解签"}).SetPriority(10).SetBlock(true).
engine.OnFullMatchGroup([]string{"解签"}).SetBlock(true).
Handle(func(ctx *zero.Ctx) {
kujiBytes, err := txt2img.RenderToBase64(getKujiByBango(bangoToday(ctx.Event.UserID)), txt2img.FontFile, 400, 20)
if err != nil {