From c083139598dcdff34496fabbb6f96e0ad27d7585 Mon Sep 17 00:00:00 2001 From: Matthew Faltys Date: Thu, 1 Feb 2018 09:38:16 -0600 Subject: [PATCH] Add summon function --- lorebot/lorebot.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lorebot/lorebot.go b/lorebot/lorebot.go index 9b82578..af449ed 100644 --- a/lorebot/lorebot.go +++ b/lorebot/lorebot.go @@ -177,6 +177,9 @@ func dynamicCommandHandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient * case "rip": s := strings.SplitN(string(ev.Text), " ", 2) riphandler(rtm, ev, s[1]) + case "summon": + s := strings.SplitN(string(ev.Text), " ", 2) + summonhandler(rtm, ev, s[1]) case "gnu": s := strings.SplitN(string(ev.Text), " ", 2) gnuhandler(rtm, ev, s[1]) @@ -271,6 +274,11 @@ func rekhandler(rtm *slack.RTM, ev *slack.MessageEvent, target string, redisClie rtm.SendMessage(rtm.NewOutgoingMessage(rekFmt, ev.Channel)) } +func summonhandler(rtm *slack.RTM, ev *slack.MessageEvent, target string) { + sumFmt := fmt.Sprintf("つ◕_◕)つ %s つ◕_◕)つ", target) + rtm.SendMessage(rtm.NewOutgoingMessage(sumFmt, ev.Channel)) +} + func riphandler(rtm *slack.RTM, ev *slack.MessageEvent, target string) { // create a timestamp to use t := time.Now()