From ce82fc9243cc959021acb9f688d3de1a998574ba Mon Sep 17 00:00:00 2001 From: Steve McCoy Date: Sat, 19 Jan 2019 10:42:43 -0500 Subject: [PATCH 1/2] Add Bulbapedia It has Special:Random, so it's definitely going to work with this, right??? --- plugins/nerdepedia/nerdepedia.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/nerdepedia/nerdepedia.go b/plugins/nerdepedia/nerdepedia.go index aa2665a..8b21aec 100644 --- a/plugins/nerdepedia/nerdepedia.go +++ b/plugins/nerdepedia/nerdepedia.go @@ -48,6 +48,8 @@ func (p *NerdepediaPlugin) Message(message msg.Message) bool { query = "http://dune.wikia.com/wiki/Special:Random" } else if lowerCase == "my precious" || lowerCase == "one ring to rule them all" || lowerCase == "one does not simply walk into mordor" { query = "http://lotr.wikia.com/wiki/Special:Random" + } else if lowerCase == "gotta catch em all" { + query = "https://bulbapedia.bulbagarden.net/wiki/Special:Random" } if query != "" { From bd99f953453330b1f7649c85cff1624a27054671 Mon Sep 17 00:00:00 2001 From: Steve McCoy Date: Sat, 24 Aug 2019 14:36:24 -0400 Subject: [PATCH 2/2] Add emoji tags to the week's winner(s) --- plugins/newsbid/newsbid.go | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/plugins/newsbid/newsbid.go b/plugins/newsbid/newsbid.go index 67128bb..b22548d 100644 --- a/plugins/newsbid/newsbid.go +++ b/plugins/newsbid/newsbid.go @@ -101,9 +101,29 @@ func (p *NewsBid) check(conn bot.Connector, ch string) { p.bot.Send(conn, bot.Message, ch, fmt.Sprintf("Error checking ngate: %s", err)) return } + + topWon := 0 + topSpread := 0 + for _, res := range wr { - msg := fmt.Sprintf("%s won %d for a score of %d", - res.User, res.Won, res.Score) + if res.Won > topWon { + topWon = res.Won + } + if len(res.WinningArticles) > topSpread { + topSpread = len(res.WinningArticles) + } + } + + for _, res := range wr { + icon := "" + if res.Won == topWon { + icon += "🏆 " + } + if len(res.WinningArticles) == topSpread { + icon += "⭐️ " + } + msg := fmt.Sprintf("%s%s won %d for a score of %d", + icon, res.User, res.Won, res.Score) if len(res.WinningArticles) > 0 { msg += "\nWinning articles: " + res.WinningArticles.Titles() }