Commit 977996d2 authored by Thomas Bella's avatar Thomas Bella

Trim username and sort descending

parent ec586044
Pipeline #1064 passed with stages
in 2 minutes and 3 seconds
......@@ -8,6 +8,7 @@ import (
"os/signal"
"sort"
"strconv"
"strings"
"sync"
"syscall"
"time"
......@@ -154,7 +155,7 @@ func GetStringResponse(chatID int64) []string {
i++
}
sort.Sort(chatPairList)
sort.Sort(sort.Reverse(chatPairList))
summaryMessagesTotal := uint64(0)
summaryActiveLastHour := 0
......@@ -181,7 +182,7 @@ func GetStringResponse(chatID int64) []string {
func AddRecord(update tgbotapi.Update) {
username := update.Message.From.UserName
if len(username) == 0 {
username = update.Message.From.FirstName + " " + update.Message.From.LastName
username = strings.TrimSpace(update.Message.From.FirstName + " " + update.Message.From.LastName)
}
MessageData.Increase(update.Message.Chat.ID, update.Message.From.ID, username)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment