mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-24 10:40:09 +08:00
🎨 改进代码样式
This commit is contained in:
parent
f2e4071b90
commit
6907fe230f
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user