mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 14:38:49 +00:00
fix: /nowplaying and /queue now indicate looping mode if enabled
This commit is contained in:
1 parent
34d50a9235
commit
3b147bd0b0
2 files changed
+44
-7
No files matched your search
+20
-4
@@ -109,6 +109,15 @@ module.exports = {
|
|||||||
.setEmoji(embedIcons.nextTrack)
|
.setEmoji(embedIcons.nextTrack)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const loopModesFormatted = new Map([
|
||||||
|
[0, 'disabled'],
|
||||||
|
[1, 'track'],
|
||||||
|
[2, 'queue'],
|
||||||
|
[3, 'autoplay']
|
||||||
|
]);
|
||||||
|
|
||||||
|
const loopModeUserString = loopModesFormatted.get(queue.repeatMode);
|
||||||
|
|
||||||
const response = await interaction.editReply({
|
const response = await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
new EmbedBuilder()
|
new EmbedBuilder()
|
||||||
@@ -122,11 +131,18 @@ module.exports = {
|
|||||||
(queue.node.isPaused()
|
(queue.node.isPaused()
|
||||||
? '**Currently Paused**\n'
|
? '**Currently Paused**\n'
|
||||||
: `**${embedIcons.audioPlaying} Now Playing**\n`) +
|
: `**${embedIcons.audioPlaying} Now Playing**\n`) +
|
||||||
(currentTrack
|
`**[${currentTrack.title}](${currentTrack.url})**` +
|
||||||
? `**[${currentTrack.title}](${currentTrack.url})**`
|
|
||||||
: 'None') +
|
|
||||||
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
|
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
|
||||||
`\n ${bar}\n\n`
|
`\n ${bar}\n\n` +
|
||||||
|
`${
|
||||||
|
queue.repeatMode === 0
|
||||||
|
? ''
|
||||||
|
: `**${
|
||||||
|
queue.repeatMode === 3
|
||||||
|
? embedIcons.autoplay
|
||||||
|
: embedIcons.loop
|
||||||
|
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with \`/loop\`.`
|
||||||
|
}`
|
||||||
)
|
)
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
|
|||||||
+24
-3
@@ -105,6 +105,25 @@ module.exports = {
|
|||||||
|
|
||||||
let currentTrack = queue.currentTrack;
|
let currentTrack = queue.currentTrack;
|
||||||
|
|
||||||
|
const loopModesFormatted = new Map([
|
||||||
|
[0, 'disabled'],
|
||||||
|
[1, 'track'],
|
||||||
|
[2, 'queue'],
|
||||||
|
[3, 'autoplay']
|
||||||
|
]);
|
||||||
|
|
||||||
|
const loopModeUserString = loopModesFormatted.get(queue.repeatMode);
|
||||||
|
|
||||||
|
let repeatModeString = `${
|
||||||
|
queue.repeatMode === 0
|
||||||
|
? ''
|
||||||
|
: `**${
|
||||||
|
queue.repeatMode === 3
|
||||||
|
? embedIcons.autoplay
|
||||||
|
: embedIcons.loop
|
||||||
|
} Looping**\nLoop mode is set to ${loopModeUserString}. You can change it with \`/loop\`.\n\n`
|
||||||
|
}`;
|
||||||
|
|
||||||
if (!currentTrack) {
|
if (!currentTrack) {
|
||||||
return await interaction.editReply({
|
return await interaction.editReply({
|
||||||
embeds: [
|
embeds: [
|
||||||
@@ -116,7 +135,8 @@ module.exports = {
|
|||||||
iconURL: interaction.guild.iconURL()
|
iconURL: interaction.guild.iconURL()
|
||||||
})
|
})
|
||||||
.setDescription(
|
.setDescription(
|
||||||
`**${embedIcons.queue} Tracks in queue**\n${queueString}`
|
`${repeatModeString}` +
|
||||||
|
`**${embedIcons.queue} Tracks in queue**\n${queueString}`
|
||||||
)
|
)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: `Page ${pageIndex + 1} of ${totalPages}`
|
text: `Page ${pageIndex + 1} of ${totalPages}`
|
||||||
@@ -159,8 +179,9 @@ module.exports = {
|
|||||||
? `**[${currentTrack.title}](${currentTrack.url})**`
|
? `**[${currentTrack.title}](${currentTrack.url})**`
|
||||||
: 'None') +
|
: 'None') +
|
||||||
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
|
`\nRequested by: <@${currentTrack.requestedBy.id}>` +
|
||||||
`\n ${bar}` +
|
`\n ${bar}\n\n` +
|
||||||
`\n\n**${embedIcons.queue} Tracks in queue**\n${queueString}`
|
`${repeatModeString}` +
|
||||||
|
`**${embedIcons.queue} Tracks in queue**\n${queueString}`
|
||||||
)
|
)
|
||||||
.setThumbnail(queue.currentTrack.thumbnail)
|
.setThumbnail(queue.currentTrack.thumbnail)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
|
|||||||
Reference in new issue
Block a user