add more limiter (#241)

This commit is contained in:
源文雨
2022-05-26 13:55:14 +08:00
parent c8072171f0
commit cb1b7d5da7
5 changed files with 10 additions and 9 deletions

View File

@@ -58,7 +58,7 @@ func init() {
logrus.Infof("[tarot]读取%d张塔罗牌", len(cardMap))
return true
},
)).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) {
)).SetBlock(true).Limit(ctxext.LimitByGroup).Handle(func(ctx *zero.Ctx) {
match := ctx.State["regex_matched"].([]string)[1]
n := 1
reasons := [...]string{"您抽到的是~\n", "锵锵锵,塔罗牌的预言是~\n", "诶,让我看看您抽到了~\n"}
@@ -148,7 +148,7 @@ func init() {
}
return true
},
)).SetBlock(true).Limit(ctxext.LimitByUser).Handle(func(ctx *zero.Ctx) {
)).SetBlock(true).Limit(ctxext.LimitByGroup).Handle(func(ctx *zero.Ctx) {
match := ctx.State["regex_matched"].([]string)[1]
info, ok := infoMap[match]
if ok {