From 1c54f2bb653bb4dfb673b9eaae7055e02336798a Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Thu, 25 Oct 2018 11:47:51 -0500 Subject: [PATCH] Add ceelo function --- lorebot/lorebot.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lorebot/lorebot.go b/lorebot/lorebot.go index 65d5d48..3ad27a6 100644 --- a/lorebot/lorebot.go +++ b/lorebot/lorebot.go @@ -245,6 +245,8 @@ func staticCommandHandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *r rrhandler(rtm, ev) case "dice": dicerollhandler(rtm, ev) + case "ceelo": + ceelorollhandler(rtm, ev) case "listen": rtm.SendMessage(rtm.NewOutgoingMessage("*it's what you hearin*", ev.Channel)) case "lorelist": @@ -352,6 +354,12 @@ func dicerollhandler(rtm *slack.RTM, ev *slack.MessageEvent) { rtm.SendMessage(rtm.NewOutgoingMessage(fmt.Sprintf("%d", rand.Intn(6)+1), ev.Channel)) } +func ceelorollhandler(rtm *slack.RTM, ev *slack.MessageEvent) { + //fmt.Print(rand.Intn(100)) + rand.Seed(time.Now().UnixNano()) + rtm.SendMessage(rtm.NewOutgoingMessage(fmt.Sprintf("%d, %d, %d", (rand.Intn(6)+1), (rand.Intn(6)+1), (rand.Intn(6)+1)), ev.Channel)) +} + func rrhandler(rtm *slack.RTM, ev *slack.MessageEvent) { //fmt.Print(rand.Intn(100)) dice := []string{"*click*", "*BANG*", "*click*", "*click*", "*click*", "*click*"}