Skip to content

Commit 01bf6f0

Browse files
authored
修复存在误解的文案 (#272)
* 修复存在误解的文案 * Update qqmapwife.go
1 parent a8d93de commit 01bf6f0

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

plugin/qqwife/qqmapwife.go

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -575,28 +575,12 @@ func init() {
575575
ctx.SendChain(message.ImageBytes(data))
576576
cl()
577577
})
578-
engine.OnFullMatchGroup([]string{"闹离婚", "办离婚"}, zero.OnlyGroup, getdb).SetBlock(true).Limit(cdcheck, iscding2).
578+
engine.OnFullMatchGroup([]string{"闹离婚", "办离婚"}, zero.OnlyGroup, getdb, checkfiancee).SetBlock(true).Limit(cdcheck, iscding2).
579579
Handle(func(ctx *zero.Ctx) {
580580
gid := ctx.Event.GroupID
581-
updatetime, err := 民政局.checkupdate(gid)
582-
switch {
583-
case err != nil:
584-
ctx.SendChain(message.Text("数据库发生问题力,请联系bot管理员\n[error]", err))
585-
return
586-
case time.Now().Format("2006/01/02") != updatetime:
587-
if err := 民政局.重置(strconv.FormatInt(gid, 10)); err != nil {
588-
ctx.SendChain(message.Text("数据库发生问题力,请联系bot管理员\n[error]", err))
589-
return
590-
}
591-
ctx.SendChain(message.Text("今天你还没有结婚哦"))
592-
return
593-
}
594-
// 获取用户信息
595581
uid := ctx.Event.UserID
596582
info, uidstatus, err := 民政局.查户口(gid, uid)
597583
switch uidstatus {
598-
case 3:
599-
return
600584
case 2:
601585
ctx.SendChain(message.Text("数据库发生问题力,请联系bot管理员\n[error]", err))
602586
return
@@ -779,6 +763,36 @@ func checkcp(ctx *zero.Ctx) bool {
779763
}
780764
return true
781765
}
766+
767+
func checkfiancee(ctx *zero.Ctx) bool {
768+
gid := ctx.Event.GroupID
769+
updatetime, err := 民政局.checkupdate(gid)
770+
switch {
771+
case err != nil:
772+
ctx.SendChain(message.Text("数据库发生问题力,请联系bot管理员\n[error]", err))
773+
return false
774+
case time.Now().Format("2006/01/02") != updatetime:
775+
if err := 民政局.重置(strconv.FormatInt(gid, 10)); err != nil {
776+
ctx.SendChain(message.Text("数据库发生问题力,请联系bot管理员\n[error]", err))
777+
return false
778+
}
779+
ctx.SendChain(message.Text("今天你还没有结婚哦"))
780+
return false
781+
}
782+
// 获取用户信息
783+
uid := ctx.Event.UserID
784+
_, uidstatus, err := 民政局.查户口(gid, uid)
785+
switch uidstatus {
786+
case 2:
787+
ctx.SendChain(message.Text("数据库发生问题力,请联系bot管理员\n[error]", err))
788+
return false
789+
case 3: // 如果是单身
790+
ctx.SendChain(message.Text("今天你还没有结婚哦"))
791+
return false
792+
}
793+
return true
794+
}
795+
782796
func iscding2(ctx *zero.Ctx) {
783-
ctx.SendChain(message.Text("打灭,禁止离婚"))
797+
ctx.SendChain(message.Text("打灭,禁止离婚 (你的技能正在CD中)"))
784798
}

0 commit comments

Comments
 (0)