diff --git a/cmd/app.go b/cmd/app.go index 839cd4a..ef8dec0 100644 --- a/cmd/app.go +++ b/cmd/app.go @@ -56,7 +56,8 @@ func (a *App) initialize() error { } // Now initialize the Slack stuff - var slackToken, slackDMid string + var slackToken string + // var slackDmid string slackToken, err = a.m.getSlackToken() if err != nil || slackToken == "" { fmt.Print("Slack API Token: ") diff --git a/plugins_src/plugin_aoc.go b/plugins_src/plugin_aoc.go index 8afa77b..632ae48 100644 --- a/plugins_src/plugin_aoc.go +++ b/plugins_src/plugin_aoc.go @@ -368,7 +368,11 @@ func (s *AoCState) AoCBoardCheckAndUpdate(yr int) { continue } if mbr.Stars != v.Stars { - s.SendSlackMessage(":christmas_tree: "+v.Name+" now has "+strconv.Itoa(v.Stars)+" stars! :christmas_tree:", channelId) + if yr == s.GetLatestYear() { + s.SendSlackMessage(fmt.Sprintf(":christmas_tree: %s now has %d stars! :christmas_tree:", v.Name, v.Stars), channelId) + } else { + s.SendSlackMessage(fmt.Sprintf(":christmas_tree: %s now has %d stars! (%d) :christmas_tree:", v.Name, v.Stars, yr), channelId) + } } } // Save the leaderboard to the db @@ -379,7 +383,7 @@ func (s *AoCState) AoCBoardCheckAndUpdate(yr int) { func (s *AoCState) AoCBoardNeedsUpdate(yr int) bool { var freshDt time.Duration if yr == s.GetLatestYear() { - freshDt, _ = time.ParseDuration("10m") + freshDt, _ = time.ParseDuration("15m") // AoC asks that we not update more than once every 15 minutes } else { freshDt, _ = time.ParseDuration("1h") }