Fix pokememes attack parsing in 10th grade profiles
This commit is contained in:
parent
3db79300af
commit
049fdd7235
@ -171,7 +171,12 @@ func (u *Users) ParseProfile(update *tgbotapi.Update, playerRaw *dbmapping.Playe
|
||||
pokememeString := string(profileRunesArray[i+1+pi])
|
||||
attackRx := regexp.MustCompile("(\\d|\\.|K|M)+")
|
||||
pkPointsArray := attackRx.FindAllString(pokememeString, -1)
|
||||
pkAttack := pkPointsArray[1]
|
||||
pkAttack := ""
|
||||
if strings.Contains(pokememeString, "🔟") {
|
||||
pkAttack = pkPointsArray[0]
|
||||
} else {
|
||||
pkAttack = pkPointsArray[1]
|
||||
}
|
||||
pkName := strings.Split(pokememeString, "+")[0]
|
||||
pkName = strings.Replace(pkName, " ⭐", "", 1)
|
||||
pkName = strings.TrimSuffix(pkName, " ")
|
||||
|
@ -179,8 +179,8 @@ func (u *Users) ProfileMessage(update *tgbotapi.Update, playerRaw *dbmapping.Pla
|
||||
for i := range profilePokememes {
|
||||
for j := range pokememes {
|
||||
if profilePokememes[i].PokememeID == pokememes[j].ID {
|
||||
message += "\n" + strconv.Itoa(pokememes[j].Grade)
|
||||
message += "⃣ " + pokememes[j].Name
|
||||
message += "\n *[" + strconv.Itoa(pokememes[j].Grade)
|
||||
message += "]* " + pokememes[j].Name
|
||||
message += " +" + c.Statistics.GetPrintablePoints(profilePokememes[i].PokememeAttack) + "⚔"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user