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

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

@@ -9,7 +9,7 @@ import (
)
func init() {
engine.OnFullMatch("哄我").SetBlock(true).SetPriority(prio).Handle(func(ctx *zero.Ctx) {
engine.OnFullMatch("哄我").SetBlock(true).Handle(func(ctx *zero.Ctx) {
if !limit.Load(ctx.Event.GroupID).Acquire() {
return
}

View File

@@ -9,7 +9,7 @@ import (
)
func init() {
engine.OnFullMatch("来碗毒鸡汤").SetBlock(true).SetPriority(prio).Handle(func(ctx *zero.Ctx) {
engine.OnFullMatch("来碗毒鸡汤").SetBlock(true).Handle(func(ctx *zero.Ctx) {
if !limit.Load(ctx.Event.GroupID).Acquire() {
return
}

View File

@@ -9,7 +9,7 @@ import (
)
func init() {
engine.OnFullMatch("发个朋友圈").SetBlock(true).SetPriority(prio).Handle(func(ctx *zero.Ctx) {
engine.OnFullMatch("发个朋友圈").SetBlock(true).Handle(func(ctx *zero.Ctx) {
if !limit.Load(ctx.Event.GroupID).Acquire() {
return
}

View File

@@ -4,6 +4,7 @@ package shadiao
import (
"time"
"github.com/FloatTech/ZeroBot-Plugin/order"
control "github.com/FloatTech/zbputils/control"
"github.com/wdvxdr1123/ZeroBot/extension/rate"
)
@@ -21,11 +22,10 @@ const (
pyqReferer = "https://pyq.shadiao.app/"
yduanziReferer = "http://www.yduanzi.com/?utm_source=shadiao.app"
loveliveReferer = "https://lovelive.tools/"
prio = 10
)
var (
engine = control.Register("shadiao", &control.Options{
engine = control.Register("shadiao", order.PrioShaDiao, &control.Options{
DisableOnDefault: false,
Help: "沙雕app\n" +
"- 哄我\n- 渣我\n- 来碗绿茶\n- 发个朋友圈\n- 来碗毒鸡汤\n- 讲个段子",

View File

@@ -10,7 +10,7 @@ import (
)
func init() {
engine.OnFullMatch("来碗绿茶").SetBlock(true).SetPriority(prio).Handle(func(ctx *zero.Ctx) {
engine.OnFullMatch("来碗绿茶").SetBlock(true).Handle(func(ctx *zero.Ctx) {
if !limit.Load(ctx.Event.GroupID).Acquire() {
return
}
@@ -23,7 +23,7 @@ func init() {
ctx.SendChain(message.Reply(ctx.Event.MessageID), message.Text(text))
})
engine.OnFullMatch("渣我").SetBlock(true).SetPriority(prio).Handle(func(ctx *zero.Ctx) {
engine.OnFullMatch("渣我").SetBlock(true).Handle(func(ctx *zero.Ctx) {
if !limit.Load(ctx.Event.GroupID).Acquire() {
return
}

View File

@@ -12,7 +12,7 @@ import (
)
func init() {
engine.OnFullMatch("讲个段子").SetBlock(true).SetPriority(prio).Handle(func(ctx *zero.Ctx) {
engine.OnFullMatch("讲个段子").SetBlock(true).Handle(func(ctx *zero.Ctx) {
if !limit.Load(ctx.Event.GroupID).Acquire() {
return
}