|
|
@ -10,6 +10,7 @@ import ( |
|
|
|
"net/http" |
|
|
|
"net/http" |
|
|
|
"net/textproto" |
|
|
|
"net/textproto" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
|
|
|
|
"os/exec" |
|
|
|
"strconv" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
"time" |
|
|
@ -238,6 +239,8 @@ func staticCommandHandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *r |
|
|
|
dicerollhandler(rtm, ev) |
|
|
|
dicerollhandler(rtm, ev) |
|
|
|
case "ceelo": |
|
|
|
case "ceelo": |
|
|
|
ceelorollhandler(rtm, ev) |
|
|
|
ceelorollhandler(rtm, ev) |
|
|
|
|
|
|
|
case "fortune": |
|
|
|
|
|
|
|
fortunehandler(rtm, ev) |
|
|
|
case "listen": |
|
|
|
case "listen": |
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage("*it's what you hearin*", ev.Channel)) |
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage("*it's what you hearin*", ev.Channel)) |
|
|
|
case "lorelist": |
|
|
|
case "lorelist": |
|
|
@ -375,6 +378,17 @@ func ceelorollhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func fortunehandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
|
|
|
|
fortune, err := exec.Command("fortune").CombinedOutput() |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
fmt.Printf("%v\n", err) |
|
|
|
|
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage("Fortune command is broken, contact HFIC", ev.Channel)) |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage(fmt.Sprintf("%s", fortune), ev.Channel)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func rrhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
func rrhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
//fmt.Print(rand.Intn(100))
|
|
|
|
//fmt.Print(rand.Intn(100))
|
|
|
|
dice := []string{"*click*", "*BANG*", "*click*", "*click*", "*click*", "*click*"} |
|
|
|
dice := []string{"*click*", "*BANG*", "*click*", "*click*", "*click*", "*click*"} |
|
|
|