mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 06:28:53 +00:00
feat: rename .js files to .ts
This commit is contained in:
1 parent
40bf9d926b
commit
92b1992b1a
54 files changed
No files matched your search
@@ -0,0 +1,34 @@
|
||||
const config = require('config');
|
||||
const embedOptions = config.get('embedOptions');
|
||||
const systemOptions = config.get('systemOptions');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
exports.notValidGuildId = async ({ interaction, executionId }) => {
|
||||
const logger = require('../../services/logger').child({
|
||||
source: 'systemCommandValidator.js',
|
||||
module: 'utilValidation',
|
||||
name: 'notValidGuildId',
|
||||
executionId: executionId,
|
||||
shardId: interaction.guild.shardId,
|
||||
guildId: interaction.guild.id
|
||||
});
|
||||
|
||||
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)
|
||||
]
|
||||
});
|
||||
|
||||
logger.debug(
|
||||
`User tried to use command '${interaction.commandName}' but system command cannot be executed in the specified guild.`
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
Reference in new issue
Block a user