fix: Add more logging to all commands

This commit is contained in:
Marius Begby committed 2023-07-19 00:44:32 +02:00
1 parent 389e60baad
commit 8ab4cbead2
13 files changed
+106 -7

No files matched your search

+8 -1
View File
@@ -1,3 +1,4 @@
const logger = require('../../services/logger');
const { embedOptions, playerOptions } = require('../../config');
const { notInVoiceChannel } = require('../../utils/validation/voiceChannelValidation');
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
@@ -20,6 +21,7 @@ module.exports = {
if (!queue) {
if (pageIndex >= 1) {
logger.debug(`User used command ${interaction.commandName} but there was no queue.`);
return await interaction.editReply({
embeds: [
new EmbedBuilder()
@@ -33,6 +35,7 @@ module.exports = {
});
}
logger.debug(`User used command ${interaction.commandName} but there was no queue.`);
queueString = 'The queue is empty, add some tracks with **`/play`**!';
return await interaction.editReply({
embeds: [
@@ -54,6 +57,8 @@ module.exports = {
const totalPages = Math.ceil(queueLength / 10) || 1;
if (pageIndex > totalPages - 1) {
logger.debug(`User used command ${interaction.commandName} but page was higher than total pages.`);
return await interaction.editReply({
embeds: [
new EmbedBuilder()
@@ -99,9 +104,10 @@ module.exports = {
queue.repeatMode === 3 ? embedOptions.icons.autoplay : embedOptions.icons.loop
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with **\`/loop\`**.\n\n`
}`;
if (!currentTrack) {
logger.debug(`User used command ${interaction.commandName} but there was no current track.`);
return await interaction.editReply({
embeds: [
new EmbedBuilder()
@@ -133,6 +139,7 @@ module.exports = {
bar = '_No duration available._';
}
logger.debug(`User used command ${interaction.commandName} and got queue in reply with current track.`);
return await interaction.editReply({
embeds: [
new EmbedBuilder()