2020-02-05 20:02:53 +00:00
|
|
|
module.exports = {
|
|
|
|
name: 'queue',
|
2020-05-15 16:05:39 +00:00
|
|
|
alias: ["q", "list", "ls", "songs"],
|
2020-04-20 16:56:23 +00:00
|
|
|
usage: '',
|
2020-02-05 20:02:53 +00:00
|
|
|
description: 'See the queue.',
|
|
|
|
onlyDev: false,
|
|
|
|
permission: 'none',
|
2020-07-12 16:08:53 +00:00
|
|
|
category: 'info',
|
2020-03-21 17:49:25 +00:00
|
|
|
async execute(msg, args, client, Discord, command) {
|
2020-03-14 16:38:02 +00:00
|
|
|
const queue = client.queue.get(msg.guild.id);
|
|
|
|
if (!queue) return msg.channel.send(client.messages.noServerQueue);
|
2020-03-13 14:20:23 +00:00
|
|
|
const page = 1;
|
2020-03-14 16:38:02 +00:00
|
|
|
let queuesongs = queue.songs.slice((page - 1) * 20 + 1, page * 20 + 1);
|
2020-02-05 20:02:53 +00:00
|
|
|
let queuemessage = `${queuesongs.map(song => `**#** ${song.title}`).join('\n')}`
|
|
|
|
const hashs = queuemessage.split('**#**').length;
|
|
|
|
for (let i = 0; i < hashs; i++) {
|
|
|
|
queuemessage = queuemessage.replace('**#**', `**${i + 1}**`);
|
|
|
|
}
|
2020-03-13 14:20:23 +00:00
|
|
|
let message;
|
2020-03-14 16:38:02 +00:00
|
|
|
message = client.messages.queueDesc.replace("%SONG%", queue.songs[0].title);
|
2020-03-13 14:20:23 +00:00
|
|
|
const embed = new Discord.MessageEmbed()
|
|
|
|
.setTitle(client.messages.queueTitle)
|
|
|
|
.setDescription(`${message}\n${queuemessage}`)
|
2020-05-06 10:19:44 +00:00
|
|
|
.setFooter(`${queue.songs.length - 1} ${client.messages.queueFooter}`)
|
2020-03-13 14:20:23 +00:00
|
|
|
.setColor(client.config.embedColor)
|
|
|
|
return msg.channel.send(embed);
|
2020-02-05 20:02:53 +00:00
|
|
|
}
|
2020-04-20 16:56:23 +00:00
|
|
|
};
|