fix: updated logging for validators

This commit is contained in:
Marius Begby committed 2023-08-26 14:39:33 +02:00
1 parent 22109823e1
commit 57fc1e3ee8
23 files changed
+118 -70

No files matched your search

+13 -1
View File
@@ -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;
}