feat: Renamed validator files and added permission validator

This commit is contained in:
Marius Begby committed 2023-07-23 11:19:21 +02:00
1 parent f04937eee0
commit b68b7dac95
18 files changed
+51 -22

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
const logger = require('../../services/logger');
const { embedOptions } = require('../../config');
const { EmbedBuilder } = require('discord.js');
exports.queueDoesNotExist = async (interaction, queue) => {
if (!queue) {
await interaction.editReply({
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nThere are no tracks in the queue and nothing currently playing. First add some tracks with **\`/play\`**!`
)
.setColor(embedOptions.colors.warning)
]
});
logger.debug(`User tried to use command ${interaction.commandName} but there was no queue.`);
return true;
}
return false;
};
exports.queueNoCurrentTrack = async (interaction, queue) => {
if (!queue.currentTrack) {
await interaction.editReply({
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedOptions.icons.warning} Oops!**\nThere is nothing currently playing. First add some tracks with **\`/play\`**!`
)
.setColor(embedOptions.colors.warning)
]
});
logger.debug(`User tried to use command ${interaction.commandName} but there was no current track.`);
return true;
}
return false;
};