2023-02-17 13:37:10 +00:00
|
|
|
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
|
2023-01-21 14:58:32 +00:00
|
|
|
const fn = require('../modules/functions.js');
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
data: new SlashCommandBuilder()
|
|
|
|
.setName('setupinfo')
|
2023-02-17 13:35:06 +00:00
|
|
|
.setDescription('View information about how the bot is set up in your server')
|
|
|
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
2023-02-12 22:16:03 +00:00
|
|
|
async execute(interaction) {
|
|
|
|
await interaction.deferReply({ ephemeral: true }).catch(err => console.error(err));
|
|
|
|
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) {
|
2023-01-25 08:07:41 +00:00
|
|
|
console.error(err);
|
2023-02-12 22:16:03 +00:00
|
|
|
await interaction.editReply(fn.builders.errorEmbed("There was an error running the command."));
|
|
|
|
}
|
2023-01-21 14:58:32 +00:00
|
|
|
},
|
|
|
|
};
|