diff --git a/commands/config.js b/commands/config.js index be25081..67539b4 100644 --- a/commands/config.js +++ b/commands/config.js @@ -100,6 +100,12 @@ module.exports = { description: "Clears all configured channels", value: "clear", type: CommandOptions.SubCommand, + }, + { + name: "view", + description: "View configured allowed channels", + value: "view", + type: CommandOptionTypes.SubCommand, } ] }, @@ -478,6 +484,30 @@ module.exports = { return interaction.send({ embeds: [promptClearChannels], components: [optClearChannels], flags: (1 << 6) }); + } else if (channels_config == 'view') { + + if (!GuildDB.customChannelStatus) { + const noConfiguredChannels = new EmbedBuilder() + .setColor(client.config.Colors.Default) + .setTitle('Channels') + .setDescription('> There are no configured channels'); + + return interaction.send({ embeds: [noConfiguredChannels] }); + } + + const configuredChannels = new EmbedBuilder() + .setColor(client.config.Colors.Default) + .setTitle('Channels') + + let des = ''; + for (let i = 0; i < GuildDB.allowedChannels.length; i++) { + if (i == 0) des += `> <#${GuildDB.allowedChannels[i]}>`; + else des += `\n> <#${GuildDB.allowedChannels[i]}>`; + } + configuredChannels.setDescription(des); + + return interaction.send({ embeds: [configuredChannels] }); + } case 'bot_admin_role': diff --git a/package.json b/package.json index 7592d3e..6bd6974 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayzr-bot", - "version": "13.3.7", + "version": "13.3.8", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "main": "index.js", "nodemonConfig": {