|
|
|
@ -211,6 +211,10 @@ func staticCommandHandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *r
|
|
|
|
|
depricatedrnghandler(rtm, ev, redisClient) |
|
|
|
|
case "roll": |
|
|
|
|
rollhandler(rtm, ev) |
|
|
|
|
case "d20": |
|
|
|
|
d20handler(rtm, ev) |
|
|
|
|
case "rr": |
|
|
|
|
rrhandler(rtm, ev) |
|
|
|
|
case "dice": |
|
|
|
|
dicerollhandler(rtm, ev) |
|
|
|
|
case "listen": |
|
|
|
@ -309,6 +313,24 @@ func dicerollhandler(rtm *slack.RTM, ev *slack.MessageEvent) {
|
|
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage(rndStr, ev.Channel)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func rrhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
|
//fmt.Print(rand.Intn(100))
|
|
|
|
|
dice := []string{"*click*", "*BANG*", "*click*", "*click*", "*click*", "*click*"} |
|
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
|
rndStr := dice[rand.Intn(len(dice)-1)] |
|
|
|
|
|
|
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage(rndStr, ev.Channel)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func d20handler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
|
//fmt.Print(rand.Intn(100))
|
|
|
|
|
dice := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20} |
|
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
|
rndStr := fmt.Sprintf("%d", dice[rand.Intn(len(dice)-1)]) |
|
|
|
|
|
|
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage(rndStr, ev.Channel)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func depricatedrnghandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *redis.Client) { |
|
|
|
|
// get random lore from list
|
|
|
|
|
rngLore, err := redisClient.SRandMember("index:lore:added").Result() |
|
|
|
|