|
|
@ -361,6 +361,12 @@ func rnghandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *redis.Clien |
|
|
|
glogger.Error.Println(err) |
|
|
|
glogger.Error.Println(err) |
|
|
|
println(err) |
|
|
|
println(err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if the array is empty, exit early
|
|
|
|
|
|
|
|
if len(command) <= 0 { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// pick a random one
|
|
|
|
// pick a random one
|
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
rngLore := fmt.Sprint(command[rand.Intn(len(command))]) |
|
|
|
rngLore := fmt.Sprint(command[rand.Intn(len(command))]) |
|
|
@ -482,11 +488,17 @@ func rmdubshandler(rtm *slack.RTM, ev *slack.MessageEvent, rmContent string, red |
|
|
|
func dubshandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *redis.Client) { |
|
|
|
func dubshandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *redis.Client) { |
|
|
|
// aka index:command:added
|
|
|
|
// aka index:command:added
|
|
|
|
newType := fmt.Sprintf("index:dubs") |
|
|
|
newType := fmt.Sprintf("index:dubs") |
|
|
|
//command, err := botfunc.Query(newType, redisClient)
|
|
|
|
|
|
|
|
command, err := loreQuery(newType, redisClient) |
|
|
|
command, err := loreQuery(newType, redisClient) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
glogger.Error.Println(err) |
|
|
|
glogger.Error.Println(err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if the array is empty, exit early
|
|
|
|
|
|
|
|
if len(command) <= 0 { |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// pick a random one
|
|
|
|
// pick a random one
|
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
rand.Seed(time.Now().UnixNano()) |
|
|
|
rngDubs := fmt.Sprint(command[rand.Intn(len(command))]) |
|
|
|
rngDubs := fmt.Sprint(command[rand.Intn(len(command))]) |
|
|
|