This commit is contained in:
cdle 2021-08-19 21:51:45 +08:00
parent 23ad661fc2
commit dc6cc89667
2 changed files with 25 additions and 13 deletions

View File

@ -178,21 +178,23 @@ var handleMessage = func(msgs ...interface{}) interface{} {
} else if tp == "tg" || tp == "tgg" {
ck.Telegram = uid
}
if nck, err := GetJdCookie(ck.PtPin); err == nil {
nck.InPool(ck.PtKey)
msg := fmt.Sprintf("更新账号,%s", ck.PtPin)
(&JdCookie{}).Push(msg)
sendMessagee("许愿币+1", msgs...)
logs.Info(msg)
if HasKey(ck.PtKey) {
sendMessagee("作弊许愿币-1", msgs...)
} else {
if Cdle {
ck.Hack = True
if nck, err := GetJdCookie(ck.PtPin); err == nil {
nck.InPool(ck.PtKey)
msg := fmt.Sprintf("更新账号,%s", ck.PtPin)
(&JdCookie{}).Push(msg)
logs.Info(msg)
} else {
if Cdle {
ck.Hack = True
}
NewJdCookie(&ck)
msg := fmt.Sprintf("添加账号,%s", ck.PtPin)
sendMessagee(fmt.Sprintf("许愿币+1余额%d", AddCoin(uid)), msgs...)
logs.Info(msg)
}
NewJdCookie(&ck)
msg := fmt.Sprintf("添加账号,%s", ck.PtPin)
(&JdCookie{}).Push(msg)
sendMessagee("许愿币+1", msgs...)
logs.Info(msg)
}
}
}

View File

@ -69,3 +69,13 @@ func NewActiveUser(class string, uid int, msgs ...interface{}) {
sendMessagee(msg, msgs...)
}
}
func AddCoin(uid int) int {
var u User
db.Where("number = ?", uid).First(&u)
db.Updates(map[string]interface{}{
"coin": gorm.Expr("coin+1"),
})
u.Coin++
return u.Coin
}