add 增加查询次数限制等各种命令限制
This commit is contained in:
parent
0ced679258
commit
072fe83e20
@ -17,7 +17,6 @@ func getLimit(uid int, typ int) bool {
|
||||
if Config.Lim == 0 {
|
||||
return true
|
||||
}
|
||||
logs.Info("开始限制")
|
||||
u := &Limit{}
|
||||
err := db.Where("number = ? and typ = ? and active_at = ?", uid, typ, time.Now().Format("2006-01-02")).First(&u).Error
|
||||
if err == nil {
|
||||
@ -31,7 +30,6 @@ func getLimit(uid int, typ int) bool {
|
||||
return false
|
||||
}
|
||||
} else {
|
||||
logs.Info("开始进入创建")
|
||||
begin := db.Begin()
|
||||
begin.Create(&Limit{
|
||||
ActiveAt: time.Now().Format("2006-01-02"),
|
||||
|
||||
@ -296,7 +296,7 @@ var codeSignals = []CodeSignal{
|
||||
sender.Reply(ck.Query())
|
||||
})
|
||||
} else {
|
||||
sender.Reply("超过今日查询次数")
|
||||
sender.Reply(fmt.Sprintf("鉴于东哥对接口限流,为了不影响大家的任务正常运行,即日起每日限流%d次,已超过今日限制", Config.Lim))
|
||||
}
|
||||
return nil
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user