silvanus/slash-commands/setupinfo.js

23 lines
956 B
JavaScript
Raw Normal View History

2023-02-17 13:37:10 +00:00
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
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) {
console.error(err);
2023-02-12 22:16:03 +00:00
await interaction.editReply(fn.builders.errorEmbed("There was an error running the command."));
}
},
};