mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 22:16:13 +00:00
fix: updated logging for validators
This commit is contained in:
1 parent
22109823e1
commit
57fc1e3ee8
23 files changed
+118
-70
No files matched your search
@@ -3,7 +3,16 @@ const embedOptions = config.get('embedOptions');
|
||||
const systemOptions = config.get('systemOptions');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
|
||||
exports.notValidGuildId = async (interaction) => {
|
||||
exports.notValidGuildId = async ({ interaction, executionId }) => {
|
||||
const logger = require('../../services/logger').child({
|
||||
source: 'systemCommandValidator.js',
|
||||
module: 'validator',
|
||||
name: 'notValidGuildId',
|
||||
executionId: executionId,
|
||||
shardId: interaction.guild.shardId,
|
||||
guildId: interaction.guild.id
|
||||
});
|
||||
|
||||
if (!systemOptions.systemGuildIds.includes(interaction.guildId)) {
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
@@ -14,6 +23,9 @@ exports.notValidGuildId = async (interaction) => {
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user