Add profile updates via statistics
After nerf update there is machine-readable command /me in PokememBroBot. It can be used for gathering useful information about users.
This commit is contained in:
@@ -42,10 +42,10 @@ func (p *Pokedexer) getAdvicePokememes(playerID int, adviceType string) ([]*data
|
||||
|
||||
allPokememes := c.DataCache.GetAllPokememes()
|
||||
neededGrade := 0
|
||||
if profileRaw.LevelID < 10 {
|
||||
if profileRaw.LevelID < 19 {
|
||||
neededGrade = profileRaw.LevelID + 1
|
||||
} else {
|
||||
neededGrade = 10
|
||||
neededGrade = 19
|
||||
}
|
||||
|
||||
c.Log.Debug("This player will search for grade: " + strconv.Itoa(neededGrade))
|
||||
@@ -90,13 +90,9 @@ func (p *Pokedexer) getAdvicePokememes(playerID int, adviceType string) ([]*data
|
||||
switch adviceType {
|
||||
case "best", "advice", "best_nofilter":
|
||||
if len(pokememesArray) > 5 {
|
||||
idx := 0
|
||||
pokememesArrayShorted := make([]*datamapping.PokememeFull, 0)
|
||||
for i := range pokememesArray {
|
||||
if idx < 5 {
|
||||
pokememesArrayShorted = append(pokememesArrayShorted, pokememesArray[i])
|
||||
}
|
||||
idx++
|
||||
for i := 0; i < 5; i++ {
|
||||
pokememesArrayShorted = append(pokememesArrayShorted, pokememesArray[i])
|
||||
}
|
||||
|
||||
pokememesArray = pokememesArrayShorted
|
||||
|
@@ -197,7 +197,6 @@ func (p *Pokedexer) PokememeInfo(update *tgbotapi.Update, playerRaw *dbmapping.P
|
||||
msg := tgbotapi.NewMessage(update.Message.Chat.ID, message)
|
||||
keyboard := tgbotapi.InlineKeyboardMarkup{}
|
||||
for i := range pokememe.Locations {
|
||||
c.Log.Info("wow, location")
|
||||
var row []tgbotapi.InlineKeyboardButton
|
||||
btn := tgbotapi.NewInlineKeyboardButtonSwitch(pokememe.Locations[i].Symbol+pokememe.Locations[i].Name, pokememe.Locations[i].Symbol+pokememe.Locations[i].Name)
|
||||
row = append(row, btn)
|
||||
|
Reference in New Issue
Block a user