Archived
1

Format imports with goimport

This commit is contained in:
2018-05-02 07:25:39 +04:00
parent ef9cf07abc
commit 86afa52a56
43 changed files with 108 additions and 128 deletions

View File

@@ -4,8 +4,9 @@
package statistics
import (
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
"strconv"
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
)
// SquadStatictics generates statistics message snippet. Public due to usage in chats list

View File

@@ -4,8 +4,8 @@
package statisticsinterface
import (
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
"github.com/go-telegram-bot-api/telegram-bot-api"
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
)
// StatisticsInterface implements Statistics for importing via appcontext.

View File

@@ -4,10 +4,11 @@
package statistics
import (
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
"github.com/go-telegram-bot-api/telegram-bot-api"
"sort"
"strconv"
"github.com/go-telegram-bot-api/telegram-bot-api"
"source.wtfteam.pro/i2_bot/i2_bot/lib/dbmapping"
)
func (s *Statistics) renderPosition(profilesRaw *[]*dbmapping.PlayerProfile, playerRaw *dbmapping.Player) string {
@@ -110,11 +111,11 @@ func (s *Statistics) TopList(update *tgbotapi.Update, playerRaw *dbmapping.Playe
message += "\n*Топ-5 по опыту*\n"
sort.Slice(profiles, func(i, j int) bool {
return profiles[i].Profile.FullExp() > profiles[j].Profile.FullExp()
return profiles[i].Profile.Exp > profiles[j].Profile.Exp
})
for i := 0; i < topLimit; i++ {
message += "*" + strconv.Itoa(i+1) + "*: " + c.Users.FormatUsername(profiles[i].Profile.Nickname) + " (" + strconv.Itoa(profiles[i].Profile.FullExp()) + " очков)\n"
message += "*" + strconv.Itoa(i+1) + "*: " + c.Users.FormatUsername(profiles[i].Profile.Nickname) + " (" + strconv.Itoa(profiles[i].Profile.Exp) + " очков)\n"
}
message += s.renderPosition(&profiles, playerRaw)