|
|
@ -306,11 +306,8 @@ func rollhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
|
|
|
|
|
|
|
|
func dicerollhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
func dicerollhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
//fmt.Print(rand.Intn(100))
|
|
|
|
//fmt.Print(rand.Intn(100))
|
|
|
|
dice := []int{1, 2, 3, 4, 5, 6} |
|
|
|
|
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
rndStr := fmt.Sprintf("%d", dice[rand.Intn(len(dice)-1)]) |
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage(fmt.Sprintf("%d", rand.Intn(6)+1), ev.Channel)) |
|
|
|
|
|
|
|
|
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage(rndStr, ev.Channel)) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func rrhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
func rrhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
@ -324,11 +321,8 @@ func rrhandler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
|
|
|
|
|
|
|
|
func d20handler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
func d20handler(rtm *slack.RTM, ev *slack.MessageEvent) { |
|
|
|
//fmt.Print(rand.Intn(100))
|
|
|
|
//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()) |
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
rndStr := fmt.Sprintf("%d", dice[rand.Intn(len(dice)-1)]) |
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage(fmt.Sprintf("%d", rand.Intn(20)+1), ev.Channel)) |
|
|
|
|
|
|
|
|
|
|
|
rtm.SendMessage(rtm.NewOutgoingMessage(rndStr, ev.Channel)) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func depricatedrnghandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *redis.Client) { |
|
|
|
func depricatedrnghandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *redis.Client) { |
|
|
|