Browse Source

Add ceelo function

develop
Matthew Faltys 6 years ago
parent
commit
1c54f2bb65
  1. 8
      lorebot/lorebot.go

8
lorebot/lorebot.go

@ -245,6 +245,8 @@ func staticCommandHandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *r
rrhandler(rtm, ev) rrhandler(rtm, ev)
case "dice": case "dice":
dicerollhandler(rtm, ev) dicerollhandler(rtm, ev)
case "ceelo":
ceelorollhandler(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":
@ -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)) 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) { 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*"}

Loading…
Cancel
Save