From 208b61f1b943ef65b26feba39e3fcd2ad68d02a0 Mon Sep 17 00:00:00 2001 From: SowinskiBraeden Date: Wed, 7 Dec 2022 18:01:57 -0800 Subject: [PATCH] 4.2.1 debug factions command with 0 factions --- commands/factions.js | 14 +++++++++----- package.json | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/commands/factions.js b/commands/factions.js index fd95e0a..30be8d8 100644 --- a/commands/factions.js +++ b/commands/factions.js @@ -26,12 +26,16 @@ module.exports = { let factions = new EmbedBuilder() .setColor(client.config.Colors.Default) .setTitle('Factions & Armbands') - + let description = ''; - - for (const [factionID, data] of Object.entries(GuildDB.factionArmbands)) { - if (description == "") description += `> <@&${factionID}> - ${data.armband}`; - else description += `\n> <@&${factionID}> - *${data.armband}*`; + + if (GuildDB.usedArmbands.length == 0) { + description = '> There are no factions that have claimed armbands.'; + } else { + for (const [factionID, data] of Object.entries(GuildDB.factionArmbands)) { + if (description == "") description += `> <@&${factionID}> - ${data.armband}`; + else description += `\n> <@&${factionID}> - *${data.armband}*`; + } } factions.setDescription(description); diff --git a/package.json b/package.json index 4767e18..68b90d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayz-armbands", - "version": "4.2.0", + "version": "4.2.1", "description": "A Discord Bot to handle DayZ server flags and armbands for in game factions.", "main": "index.js", "nodemonConfig": {