diff --git a/commands/rr.js b/commands/rr.js index 1a8dec7..ff91533 100644 --- a/commands/rr.js +++ b/commands/rr.js @@ -648,8 +648,12 @@ export default { let textZoznam = `# zoznam kolekcií` - for (const kolekcia of Object.keys(kolekcie)) { - textZoznam += `\n- ${kolekcia}` + if (Object.keys(kolekcie)) { + for (const kolekcia of Object.keys(kolekcie)) { + textZoznam += `\n- ${kolekcia}` + } + } else { + textZoznam += `ziadne kolekcie` } await interaction.createFollowup({ @@ -693,8 +697,12 @@ export default { let textZoznam = `# zoznam rolí (${kolekcia})` - for (const rola of role) { - textZoznam += `\n- ${rola.nazov} <@&${rola.id}>` + if (role) { + for (const rola of role) { + textZoznam += `\n- ${rola.nazov} <@&${rola.id}>` + } + } else { + textZoznam += `ziadne kolekcie` } await interaction.createFollowup({