fix: 优化扭蛋提示信息
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-27 11:52:08 +08:00
committed by cnb
parent ed84e4d2df
commit 5e8a09c226

View File

@@ -23,21 +23,25 @@ func init() {
if len(msgs) > 1 { if len(msgs) > 1 {
count = gconv.Int(msgs[1]) count = gconv.Int(msgs[1])
} else {
ctx.Send("参数错误")
} }
if count > 10 { if count > 10 {
count = 10 count = 10
} }
user := base.NewBaseSysUserService().GetQQ(ctx.Event.Sender.ID) user := base.NewBaseSysUserService().GetQQ(ctx.Event.Sender.ID)
if user == nil { if user == nil {
ctx.Send("未绑定") ctx.Send("未绑定请个人中心复制token发给机器人")
return return
} }
itemservice := service.NewItemService(uint32(user.ID)) itemservice := service.NewItemService(uint32(user.ID))
if itemservice.CheakItem(400501) < int64(count) { havs := itemservice.CheakItem(400501)
ctx.Send("扭蛋币不足") if havs < int64(count) {
ctx.Send("扭蛋币不足,当前扭蛋币数量:" + gconv.String(havs))
return return
} }
var buf strings.Builder var buf strings.Builder
buf.WriteString("当前扭蛋币数量:" + gconv.String(havs))
if grand.Meet(int(count), 100) { if grand.Meet(int(count), 100) {
r := config.NewPetRewardService().GetEgg() r := config.NewPetRewardService().GetEgg()
newPet := model.GenPetInfo(int(r.MonID), int(r.DV), int(r.Nature), int(r.Effect), int(r.Lv), nil, 0) newPet := model.GenPetInfo(int(r.MonID), int(r.DV), int(r.Nature), int(r.Effect), int(r.Lv), nil, 0)