From 1842aeba821654c18f438c634f31a996363e6e55 Mon Sep 17 00:00:00 2001 From: skkiesel Date: Tue, 12 Feb 2019 11:03:24 -0500 Subject: [PATCH] A new small tea-ture --- plugins/counter/counter.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/counter/counter.go b/plugins/counter/counter.go index b23c4ae..b7729cd 100644 --- a/plugins/counter/counter.go +++ b/plugins/counter/counter.go @@ -6,6 +6,7 @@ import ( "database/sql" "fmt" "log" + "math/rand" "regexp" "strconv" "strings" @@ -474,7 +475,16 @@ func (p *CounterPlugin) checkMatch(message msg.Message) bool { } log.Printf("About to update item: %#v", item) item.UpdateDelta(1) - p.Bot.Send(bot.Message, channel, fmt.Sprintf("bleep-bloop-blop... %s has %d %s", - nick, item.Count, itemName)) + p.Bot.Send(bot.Message, channel, fmt.Sprintf("%s... %s has %d %s", + strings.Join(everyDayImShuffling([]string{"bleep", "bloop", "blop"}), "-"), nick, item.Count, itemName)) return true } + +func everyDayImShuffling(vals []string) []string { + ret := make([]string, len(vals)) + perm := rand.Perm(len(vals)) + for i, randIndex := range perm { + ret[i] = vals[randIndex] + } + return ret +}