M engine/discord.go => engine/discord.go +6 -1
@@ 409,7 409,7 @@ func listOnline(ctx *exrouter.Context) {
onlineList := ListOnlinePlayers(guilds)
if len(onlineList) == 0 {
- ctx.Reply("There are no players online. Do the bed defence yourself, dummy!")
+ ctx.Reply("There are no players online. How about you get online?")
return
}
@@ 448,6 448,11 @@ func bedDefence(ctx *exrouter.Context) {
// Fetch list of online UUIDs in the monitored guilds
onlineList := ListOnlinePlayers(guilds)
+ if len(onlineList) == 0 {
+ ctx.Reply("There are no players online. Do the bed defence yourself, dummy!")
+ return
+ }
+
// Choose a random UUID
randomIndex := rand.Intn(len(onlineList))
M engine/tracking.go => engine/tracking.go +1 -1
@@ 215,7 215,7 @@ func SendStatusNotifications(uuid string, newStatus bool) error {
// TODO add error checking
func GetCachedPlayerStatus(uuid string) bool {
- var result = false
+ var result = false
Iron.View(func(tx *bolt.Tx) error {
b := tx.Bucket([]byte("tracked"))
M main.go => main.go +2 -2
@@ 7,8 7,8 @@ import (
"os/signal"
"syscall"
- "git.sr.ht/~exprez135/go-hypixel/engine"
- //"./engine"
+ //"git.sr.ht/~exprez135/go-hypixel/engine"
+ "./engine"
)
var platformName = "discord"