🎨 改进代码样式

This commit is contained in:
github-actions[bot] 2022-05-12 03:23:21 +00:00
parent f2e4071b90
commit 6907fe230f

View File

@ -139,7 +139,7 @@ func init() {
// 更新时间
lastdate = time.Now()
})
//单生狗专属技能
// 单生狗专属技能
var singledogCD = ctxext.NewLimiterManager(time.Hour*24, 1)
engine.OnRegex(`^娶(\d+|\[CQ:at,qq=(\d+)\])`, zero.OnlyGroup, checkdog).SetBlock(true).Limit(singledogCD.LimitByUser).
Handle(func(ctx *zero.Ctx) {
@ -198,13 +198,13 @@ func init() {
})
}
//注入判断 是否为单身狗
// 注入判断 是否为单身狗
func checkdog(ctx *zero.Ctx) bool {
fiancee, err := strconv.ParseInt(ctx.State["regex_matched"].([]string)[1], 10, 64)
//fmt.Println("1:", fiancee)
// fmt.Println("1:", fiancee)
if err != nil {
fiancee, _ = strconv.ParseInt(ctx.State["regex_matched"].([]string)[2], 10, 64)
//fmt.Println("2:", fiancee)
// fmt.Println("2:", fiancee)
}
gid := ctx.Event.GroupID
uid := ctx.Event.UserID