diff --git a/commands/leaderboard.js b/commands/leaderboard.js index 90976ab..93fa5d2 100644 --- a/commands/leaderboard.js +++ b/commands/leaderboard.js @@ -17,8 +17,9 @@ module.exports = { let text = "" for(let i = 0; i < 5; i++) { - if(data === undefined) break - text += `${i + 1}. ${data[i].ID} (${data[i].data} cm) ` + if(data[i] != undefined) { + text += `${i + 1}. ${data[i].ID} (${data[i].data} cm) ` + } } bot.say(event.target, 'Cactus Leaderboard: ' + text)