Try to fix that all years star count again
This commit is contained in:
parent
9ab1706b9d
commit
76247e0d63
@ -411,11 +411,13 @@ func (s *AoCState) AoCBoardCheckAndUpdate(yr int) {
|
|||||||
plural = "stars"
|
plural = "stars"
|
||||||
}
|
}
|
||||||
mbrAll := s.getMemberAllYears(v.ID)
|
mbrAll := s.getMemberAllYears(v.ID)
|
||||||
|
// Gather all stars from all leaderboards
|
||||||
var totalStars int
|
var totalStars int
|
||||||
for _, v := range mbrAll {
|
for _, v := range mbrAll {
|
||||||
totalStars += v.Stars
|
totalStars += v.Stars
|
||||||
}
|
}
|
||||||
allYearsText := fmt.Sprintf(" (%d for all years)", totalStars+v.Stars)
|
// Add this new one into the total
|
||||||
|
allYearsText := fmt.Sprintf(" (%d for all years)", totalStars+1)
|
||||||
if yr == s.GetLatestYear() {
|
if yr == s.GetLatestYear() {
|
||||||
s.SendSlackMessage(fmt.Sprintf(":christmas_tree: %s now has %d %s! :christmas_tree:%s", v.Name, v.Stars, plural, allYearsText), channelId)
|
s.SendSlackMessage(fmt.Sprintf(":christmas_tree: %s now has %d %s! :christmas_tree:%s", v.Name, v.Stars, plural, allYearsText), channelId)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user