|
|
|
@ -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() |
|
|
|
|