Pluralize (or not) 'Stars'
This commit is contained in:
parent
cf18b7a1a3
commit
24c7c80fbb
@ -368,10 +368,14 @@ func (s *AoCState) AoCBoardCheckAndUpdate(yr int) {
|
||||
continue
|
||||
}
|
||||
if mbr.Stars != v.Stars {
|
||||
plural := "star"
|
||||
if v.Stars > 1 {
|
||||
plural = "stars"
|
||||
}
|
||||
if yr == s.GetLatestYear() {
|
||||
s.SendSlackMessage(fmt.Sprintf(":christmas_tree: %s now has %d stars! :christmas_tree:", v.Name, v.Stars), channelId)
|
||||
s.SendSlackMessage(fmt.Sprintf(":christmas_tree: %s now has %d %s! :christmas_tree:", v.Name, v.Stars, plural), channelId)
|
||||
} else {
|
||||
s.SendSlackMessage(fmt.Sprintf(":christmas_tree: %s now has %d stars! (%d) :christmas_tree:", v.Name, v.Stars, yr), channelId)
|
||||
s.SendSlackMessage(fmt.Sprintf(":christmas_tree: %s now has %d %s! (%d) :christmas_tree:", v.Name, v.Stars, plural, yr), channelId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user