Browse Source

Add additional rng logging

develop
Matthew Faltys 6 years ago
parent
commit
f4cc4b99fa
  1. 5
      lorebot/lorebot.go

5
lorebot/lorebot.go

@ -429,15 +429,16 @@ func rnghandler(rtm *slack.RTM, ev *slack.MessageEvent, redisClient *redis.Clien
// 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))])
println(rngLore) glogger.Debug.Printf("rng lore: %s\n", rngLore)
// get lore content // get lore content
rngContent, err := loreCheck(rngLore, "lore", redisClient) rngContent, err := loreCheck(rngLore, "lore", redisClient)
if err != nil { if err != nil {
fmt.Printf("%v\n", err) glogger.Error.Printf("%v\n", err)
rtm.SendMessage(rtm.NewOutgoingMessage("beep boop.. broken bot..", ev.Channel)) rtm.SendMessage(rtm.NewOutgoingMessage("beep boop.. broken bot..", ev.Channel))
return return
} }
glogger.Debug.Printf("rng content: %s\n", rngContent)
rngMsg := fmt.Sprintf("Random lore: `%s`\n%s", rngLore, rngContent) rngMsg := fmt.Sprintf("Random lore: `%s`\n%s", rngLore, rngContent)
rtm.SendMessage(rtm.NewOutgoingMessage(rngMsg, ev.Channel)) rtm.SendMessage(rtm.NewOutgoingMessage(rngMsg, ev.Channel))
} }

Loading…
Cancel
Save