feat!: Updated configuration and moved config location

This commit is contained in:
Marius Begby committed 2023-07-18 13:11:15 +02:00
1 parent 2d0df79dac
commit dd4b56ae67
40 files changed
+468 -482

No files matched your search

+21 -23
View File
@@ -1,8 +1,6 @@
const path = require('node:path');
const { SlashCommandBuilder } = require('@discordjs/builders');
const { embedOptions, playerOptions } = require('../../config');
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const { useQueue } = require('discord-player');
const { EmbedBuilder } = require('discord.js');
const { embedColors, embedIcons, progressBarOptions } = require(path.resolve('./config.json'));
module.exports = {
data: new SlashCommandBuilder()
@@ -16,9 +14,9 @@ module.exports = {
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedIcons.warning} Oops!**\nYou need to be in a voice channel to use this command.`
`**${embedOptions.icons.warning} Oops!**\nYou need to be in a voice channel to use this command.`
)
.setColor(embedColors.colorWarning)
.setColor(embedOptions.colors.warning)
]
});
}
@@ -33,11 +31,11 @@ module.exports = {
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedIcons.warning} Oops!**\nPage \`${
`**${embedOptions.icons.warning} Oops!**\nPage \`${
pageIndex + 1
}\` is not a valid page number.\n\nThe queue is currently empty, first add some tracks with **\`/play\`**!`
)
.setColor(embedColors.colorWarning)
.setColor(embedOptions.colors.warning)
]
});
}
@@ -50,8 +48,8 @@ module.exports = {
name: interaction.guild.name,
iconURL: interaction.guild.iconURL()
})
.setDescription(`**${embedIcons.queue} Tracks in queue**\n${queueString}`)
.setColor(embedColors.colorInfo)
.setDescription(`**${embedOptions.icons.queue} Tracks in queue**\n${queueString}`)
.setColor(embedOptions.colors.info)
.setFooter({
text: 'Page 1 of 1'
})
@@ -66,11 +64,11 @@ module.exports = {
embeds: [
new EmbedBuilder()
.setDescription(
`**${embedIcons.warning} Oops!**\nPage \`${
`**${embedOptions.icons.warning} Oops!**\nPage \`${
pageIndex + 1
}\` is not a valid page number.\n\nThere are only a total of \`${totalPages}\` pages in the queue.`
)
.setColor(embedColors.colorWarning)
.setColor(embedOptions.colors.warning)
]
});
}
@@ -104,7 +102,7 @@ module.exports = {
queue.repeatMode === 0
? ''
: `**${
queue.repeatMode === 3 ? embedIcons.autoplay : embedIcons.loop
queue.repeatMode === 3 ? embedOptions.icons.autoplay : embedOptions.icons.loop
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with **\`/loop\`**.\n\n`
}`;
@@ -117,23 +115,23 @@ module.exports = {
iconURL: interaction.guild.iconURL()
})
.setDescription(
`${repeatModeString}` + `**${embedIcons.queue} Tracks in queue**\n${queueString}`
`${repeatModeString}` + `**${embedOptions.icons.queue} Tracks in queue**\n${queueString}`
)
.setFooter({
text: `Page ${pageIndex + 1} of ${totalPages}`
})
.setColor(embedColors.colorInfo)
.setColor(embedOptions.colors.info)
]
});
} else {
const timestamp = queue.node.getTimestamp();
let bar = `**\`${timestamp.current.label}\`** ${queue.node.createProgressBar({
queue: false,
length: progressBarOptions.length ?? 12,
timecodes: progressBarOptions.timecodes ?? false,
indicator: progressBarOptions.indicator ?? '🔘',
leftChar: progressBarOptions.leftChar ?? '▬',
rightChar: progressBarOptions.rightChar ?? '▬'
length: playerOptions.progressBar.length ?? 12,
timecodes: playerOptions.progressBar.timecodes ?? false,
indicator: playerOptions.progressBar.indicator ?? '🔘',
leftChar: playerOptions.progressBar.leftChar ?? '▬',
rightChar: playerOptions.progressBar.rightChar ?? '▬'
})} **\`${timestamp.total.label}\`**`;
if (currentTrack.raw.duration === 0 || currentTrack.duration === '0:00') {
@@ -148,18 +146,18 @@ module.exports = {
iconURL: interaction.guild.iconURL()
})
.setDescription(
`**${embedIcons.audioPlaying} Now playing**\n` +
`**${embedOptions.icons.audioPlaying} Now playing**\n` +
(currentTrack ? `**[${currentTrack.title}](${currentTrack.url})**` : 'None') +
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
`\n ${bar}\n\n` +
`${repeatModeString}` +
`**${embedIcons.queue} Tracks in queue**\n${queueString}`
`**${embedOptions.icons.queue} Tracks in queue**\n${queueString}`
)
.setThumbnail(queue.currentTrack.thumbnail)
.setFooter({
text: `Page ${pageIndex + 1} of ${totalPages}`
})
.setColor(embedColors.colorInfo)
.setColor(embedOptions.colors.info)
]
});
}