Update queue.js
This commit is contained in:
parent
cb9bf7d7a1
commit
ca3b6bcdd4
|
@ -8,6 +8,8 @@ module.exports = {
|
||||||
const queue = getQueue(message.guild.id);
|
const queue = getQueue(message.guild.id);
|
||||||
const currentTrack = getCurrentTrack(message.guild.id);
|
const currentTrack = getCurrentTrack(message.guild.id);
|
||||||
|
|
||||||
|
const pageSize = 8;
|
||||||
|
|
||||||
const embed = new EmbedBuilder()
|
const embed = new EmbedBuilder()
|
||||||
.setColor('#0099ff')
|
.setColor('#0099ff')
|
||||||
.setTitle('Current Queue');
|
.setTitle('Current Queue');
|
||||||
|
@ -24,7 +26,7 @@ module.exports = {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (queue.length > 0) {
|
if (queue.length > 0) {
|
||||||
const queueDisplay = queue.map((track, index) => {
|
const queueDisplay = queue.slice(0, pageSize).map((track, index) => {
|
||||||
const trackDisplay = track.url
|
const trackDisplay = track.url
|
||||||
? `**${index + 1}.** [${track.title}](${track.url})\nRequested by: ${track.requester}`
|
? `**${index + 1}.** [${track.title}](${track.url})\nRequested by: ${track.requester}`
|
||||||
: `**${index + 1}.** ${track.title}\nRequested by: ${track.requester}`;
|
: `**${index + 1}.** ${track.title}\nRequested by: ${track.requester}`;
|
||||||
|
@ -36,6 +38,10 @@ module.exports = {
|
||||||
value: queueDisplay,
|
value: queueDisplay,
|
||||||
inline: false
|
inline: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (queue.length > pageSize) {
|
||||||
|
embed.setFooter({ text: `And ${queue.length - pageSize} more...` });
|
||||||
|
}
|
||||||
} else if (!currentTrack) {
|
} else if (!currentTrack) {
|
||||||
embed.setDescription('The queue is empty!');
|
embed.setDescription('The queue is empty!');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue