leaderboard now works when there's less than 5 people in the db
This commit is contained in:
parent
dabe2a1ae3
commit
3869e91ed2
|
@ -17,8 +17,9 @@ module.exports = {
|
||||||
|
|
||||||
let text = ""
|
let text = ""
|
||||||
for(let i = 0; i < 5; i++) {
|
for(let i = 0; i < 5; i++) {
|
||||||
if(data === undefined) break
|
if(data[i] != undefined) {
|
||||||
text += `${i + 1}. ${data[i].ID} (${data[i].data} cm) `
|
text += `${i + 1}. ${data[i].ID} (${data[i].data} cm) `
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bot.say(event.target, 'Cactus Leaderboard: ' + text)
|
bot.say(event.target, 'Cactus Leaderboard: ' + text)
|
||||||
|
|
Loading…
Reference in New Issue