Commit 5f2242a2 authored by Thomas Bella's avatar Thomas Bella

Add time of first message

parent 23fda3ee
Pipeline #1083 passed with stages
in 2 minutes and 22 seconds
......@@ -24,7 +24,8 @@ type MessageStat struct {
// SingleChat contains info about a single chat
type SingleChat struct {
User map[int]SingleUser
User map[int]SingleUser
FirstMessage time.Time
}
// SingleUser contains information about a single user
......@@ -59,6 +60,7 @@ func (s *MessageStat) Increase(chat int64, user int, username string) {
Username: username,
},
},
FirstMessage: time.Now(),
}
} else {
s.Chat[chat].User[user] = SingleUser{
......@@ -181,7 +183,7 @@ func GetStringResponse(chatID int64) []string {
}
}
return []string{text, "*Summary*\n" + strconv.FormatUint(summaryMessagesTotal, 10) + " messages sent\n" + strconv.Itoa(summaryActiveLastHour) + " users active within the last hour\n" + strconv.Itoa(summaryActiveLastDay) + " users active within the last 24 hours"}
return []string{text, "*Summary*\nStats since " + chatData.FirstMessage.Format("02.01.2006 15:04:05") + "\n" + strconv.FormatUint(summaryMessagesTotal, 10) + " messages sent\n" + strconv.Itoa(summaryActiveLastHour) + " users active within the last hour\n" + strconv.Itoa(summaryActiveLastDay) + " users active within the last 24 hours"}
}
// AddRecord increases the message count
......
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