diff --git a/lorebot/lorebot.go b/lorebot/lorebot.go index 1b12640..9b82578 100644 --- a/lorebot/lorebot.go +++ b/lorebot/lorebot.go @@ -174,6 +174,9 @@ func dynamicCommandHandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient * case "rek": s := strings.SplitN(string(ev.Text), " ", 2) rekhandler(rtm, ev, s[1], redisClient) + case "rip": + s := strings.SplitN(string(ev.Text), " ", 2) + riphandler(rtm, ev, s[1]) case "gnu": s := strings.SplitN(string(ev.Text), " ", 2) gnuhandler(rtm, ev, s[1]) @@ -268,6 +271,14 @@ func rekhandler(rtm *slack.RTM, ev *slack.MessageEvent, target string, redisClie rtm.SendMessage(rtm.NewOutgoingMessage(rekFmt, ev.Channel)) } +func riphandler(rtm *slack.RTM, ev *slack.MessageEvent, target string) { + // create a timestamp to use + t := time.Now() + tstamp := t.Format("01-02-2006") + ripFmt := fmt.Sprintf("here lies %s, disrespected to death %s..", target, tstamp) + rtm.SendMessage(rtm.NewOutgoingMessage(ripFmt, ev.Channel)) +} + func rnghandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *redis.Client) { // get random lore from list rngLore, err := redisClient.SRandMember("index:lore:added").Result()