fix: 优化扭蛋提示信息
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -23,21 +23,25 @@ func init() {
|
||||
if len(msgs) > 1 {
|
||||
count = gconv.Int(msgs[1])
|
||||
|
||||
} else {
|
||||
ctx.Send("参数错误")
|
||||
}
|
||||
if count > 10 {
|
||||
count = 10
|
||||
}
|
||||
user := base.NewBaseSysUserService().GetQQ(ctx.Event.Sender.ID)
|
||||
if user == nil {
|
||||
ctx.Send("未绑定")
|
||||
ctx.Send("未绑定,请个人中心复制token发给机器人")
|
||||
return
|
||||
}
|
||||
itemservice := service.NewItemService(uint32(user.ID))
|
||||
if itemservice.CheakItem(400501) < int64(count) {
|
||||
ctx.Send("扭蛋币不足")
|
||||
havs := itemservice.CheakItem(400501)
|
||||
if havs < int64(count) {
|
||||
ctx.Send("扭蛋币不足,当前扭蛋币数量:" + gconv.String(havs))
|
||||
return
|
||||
}
|
||||
var buf strings.Builder
|
||||
buf.WriteString("当前扭蛋币数量:" + gconv.String(havs))
|
||||
if grand.Meet(int(count), 100) {
|
||||
r := config.NewPetRewardService().GetEgg()
|
||||
newPet := model.GenPetInfo(int(r.MonID), int(r.DV), int(r.Nature), int(r.Effect), int(r.Lv), nil, 0)
|
||||
|
||||
Reference in New Issue
Block a user