Sort GP list by amount
This commit is contained in:
parent
eb10fde8f7
commit
52f4898c2b
3 changed files with 9 additions and 9 deletions
|
@ -42,13 +42,13 @@ func GetGP(update tgbotapi.Update, bot *tgbotapi.BotAPI) {
|
|||
gps := sqlGetAllGP(update.Message.Chat.ID)
|
||||
|
||||
var messagetext string
|
||||
for userid, points := range gps {
|
||||
currentUser := botIO.GetUserByID(update.Message.Chat.ID, userid, bot)
|
||||
for _, gaypointInfo := range gps {
|
||||
currentUser := botIO.GetUserByID(update.Message.Chat.ID, gaypointInfo.userID, bot)
|
||||
currentName := currentUser.User.FirstName
|
||||
if currentUser.User.UserName != "" {
|
||||
currentName = currentUser.User.UserName
|
||||
}
|
||||
text := `<a href="` + `tg://user?id=` + strconv.FormatInt(userid, 10) + `">` + currentName + `</a>` + ` currently has ` + `<b>` + strconv.FormatInt(points, 10) + `</b>` + ` gaypoints` + "\n"
|
||||
text := `<a href="` + `tg://user?id=` + strconv.FormatInt(gaypointInfo.userID, 10) + `">` + currentName + `</a>` + ` currently has ` + `<b>` + strconv.FormatInt(gaypointInfo.gaypoints, 10) + `</b>` + ` gaypoints` + "\n"
|
||||
|
||||
messagetext = messagetext + text
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue