feat: Renamed validator files and added permission validator

This commit is contained in:
Marius Begby committed 2023-07-23 11:19:21 +02:00
1 parent f04937eee0
commit b68b7dac95
18 files changed
+51 -22

No files matched your search

@@ -0,0 +1,19 @@
const { embedOptions, systemOptions } = require('../../config');
const { EmbedBuilder } = require('discord.js');
exports.notValidGuildId = async (interaction) => {
if (!systemOptions.systemGuildIds.includes(interaction.guildId)) {
await interaction.editReply({
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nNo permission to execute this command.\n\nThe command \`${interaction.commandName}\` cannot be executed in this server.`
)
.setColor(embedOptions.colors.warning)
]
});
return true;
}
return false;
};