fix: updated logging for commands

This commit is contained in:
Marius Begby committed 2023-08-26 17:00:08 +02:00
1 parent 5c8f3353f9
commit a04d0aeb5b
24 files changed
+510 -292

No files matched your search

+11 -5
View File
@@ -1,4 +1,3 @@
const logger = require('../../services/logger');
const config = require('config');
const embedOptions = config.get('embedOptions');
const { notInVoiceChannel, notInSameVoiceChannel } = require('../../utils/validation/voiceChannelValidator');
@@ -15,6 +14,15 @@ module.exports = {
.setDMPermission(false)
.setNSFW(false),
execute: async ({ interaction, executionId }) => {
const logger = require('../../services/logger').child({
source: 'shuffle.js',
module: 'slashCommand',
name: '/shuffle',
executionId: executionId,
shardId: interaction.guild.shardId,
guildId: interaction.guild.id
});
if (await notInVoiceChannel({ interaction, executionId })) {
return;
}
@@ -34,11 +42,9 @@ module.exports = {
}
queue.tracks.shuffle();
logger.debug('Shuffled queue tracks.');
logger.debug(
`User used command ${interaction.commandName} and shuffled the queue.`
);
logger.debug('Responding with success embed.');
return await interaction.editReply({
embeds: [
new EmbedBuilder()