mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 22:15:29 +00:00
fix: update progress bar in queue command
This commit is contained in:
1 parent
f87d35e635
commit
df9b0005ad
1 file changed
+12
-5
+12
-5
@@ -1,7 +1,7 @@
|
|||||||
const { SlashCommandBuilder } = require('@discordjs/builders');
|
const { SlashCommandBuilder } = require('@discordjs/builders');
|
||||||
const { useQueue } = require('discord-player');
|
const { useQueue } = require('discord-player');
|
||||||
const { EmbedBuilder } = require('discord.js');
|
const { EmbedBuilder } = require('discord.js');
|
||||||
const { embedColors } = require('../config.json');
|
const { embedColors, progressBarOptions } = require('../config.json');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
@@ -71,7 +71,7 @@ module.exports = {
|
|||||||
let durationFormat =
|
let durationFormat =
|
||||||
track.raw.duration === 0 || track.duration === '0:00'
|
track.raw.duration === 0 || track.duration === '0:00'
|
||||||
? ''
|
? ''
|
||||||
: `\`[${track.duration}]\``;
|
: `\`${track.duration}\``;
|
||||||
|
|
||||||
return `**${page * 10 + index + 1}.** ${durationFormat} [${
|
return `**${page * 10 + index + 1}.** ${durationFormat} [${
|
||||||
track.title
|
track.title
|
||||||
@@ -98,10 +98,17 @@ module.exports = {
|
|||||||
]
|
]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
let bar = queue.node.createProgressBar({
|
const timestamp = queue.node.getTimestamp();
|
||||||
|
let bar = `\`${
|
||||||
|
timestamp.current.label
|
||||||
|
}\` ${queue.node.createProgressBar({
|
||||||
queue: false,
|
queue: false,
|
||||||
length: 13
|
length: progressBarOptions.length ?? 12,
|
||||||
});
|
timecodes: progressBarOptions.timecodes ?? false,
|
||||||
|
indicator: progressBarOptions.indicator ?? '🔘',
|
||||||
|
leftChar: progressBarOptions.leftChar ?? '▬',
|
||||||
|
rightChar: progressBarOptions.rightChar ?? '▬'
|
||||||
|
})} \`${timestamp.total.label}\``;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
currentTrack.raw.duration === 0 ||
|
currentTrack.raw.duration === 0 ||
|
||||||
|
|||||||
Reference in new issue
Block a user