diff --git a/slash-commands/setup.js b/slash-commands/setup.js index 3ac0069..b24133e 100755 --- a/slash-commands/setup.js +++ b/slash-commands/setup.js @@ -36,6 +36,9 @@ module.exports = { .setRequired(false) ) ) + .addSubcommand(sc => + sc.setName('view') + .setDescription('View your server\'s configuration')) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), async execute(interaction) { await interaction.deferReply({ ephemeral: true }); @@ -71,6 +74,19 @@ module.exports = { await interaction.editReply(fn.builders.embeds.treeRoleMenu(guildInfo)).catch(e => console.error(e)); } break; + case "view": + try { + if (interaction.client.guildInfos.has(interaction.guildId)) { + let guildInfo = interaction.client.guildInfos.get(interaction.guildId); + await interaction.editReply(fn.builders.embed(guildInfo.generateSetupInfo())); + } else { + await interaction.editReply(fn.builders.errorEmbed("Guild doesn't exist in database!")); + } + } catch (err) { + console.error(err); + await interaction.editReply(fn.builders.errorEmbed("There was an error running the command.")); + } + break; default: break; } diff --git a/slash-commands/setupinfo.js b/slash-commands/setupinfo.js deleted file mode 100755 index be409c6..0000000 --- a/slash-commands/setupinfo.js +++ /dev/null @@ -1,23 +0,0 @@ -const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js'); -const fn = require('../modules/functions.js'); - -module.exports = { - data: new SlashCommandBuilder() - .setName('setupinfo') - .setDescription('View information about how the bot is set up in your server') - .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), - async execute(interaction) { - await interaction.deferReply({ ephemeral: true }).catch(e => console.error(e)); - try { - if (interaction.client.guildInfos.has(interaction.guildId)) { - let guildInfo = interaction.client.guildInfos.get(interaction.guildId); - await interaction.editReply(fn.builders.embed(guildInfo.generateSetupInfo())); - } else { - await interaction.editReply(fn.builders.errorEmbed("Guild doesn't exist in database!")); - } - } catch (err) { - console.error(err); - await interaction.editReply(fn.builders.errorEmbed("There was an error running the command.")); - } - }, -}; \ No newline at end of file