From 24c7c80fbb0a9e57b7a93023a9982278a2ac47cc Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Wed, 2 Dec 2020 08:45:51 -0600 Subject: [PATCH] Pluralize (or not) 'Stars' --- plugins_src/plugin_aoc.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins_src/plugin_aoc.go b/plugins_src/plugin_aoc.go index 632ae48..0a34f47 100644 --- a/plugins_src/plugin_aoc.go +++ b/plugins_src/plugin_aoc.go @@ -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) } } }