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

+7
View File
@@ -1,3 +1,4 @@
const logger = require('../../services/logger');
const { embedOptions } = require('../../config');
const { EmbedBuilder } = require('discord.js');
@@ -12,6 +13,9 @@ exports.queueDoesNotExist = async (interaction, queue) => {
.setColor(embedOptions.colors.warning)
]
});
logger.debug(`User tried to use command ${interaction.commandName} but there was no queue.`);
return true;
}
@@ -29,6 +33,9 @@ exports.queueNoCurrentTrack = async (interaction, queue) => {
.setColor(embedOptions.colors.warning)
]
});
logger.debug(`User tried to use command ${interaction.commandName} but there was no current track.`);
return true;
}
@@ -11,6 +11,7 @@ exports.transformQuery = async (query) => {
// if country-based, transform to normal Spotify url
if (isCountryBased) {
logger.debug(`Transforming country-based Spotify url to normal Spotify url from query ${query}.`);
const trackId = query.match(regex)[2];
query = `https://open.spotify.com/track/${trackId}`;
}
@@ -1,3 +1,4 @@
const logger = require('../../services/logger');
const { embedOptions } = require('../../config');
const { EmbedBuilder } = require('discord.js');
@@ -12,6 +13,8 @@ exports.notInVoiceChannel = async (interaction) => {
.setColor(embedOptions.colors.warning)
]
});
logger.debug(`User tried to use command ${interaction.commandName} but was not in a voice channel.`);
return true;
}