-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqueue.js
40 lines (35 loc) · 1.13 KB
/
queue.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const { MessageEmbed } = require('discord.js');
module.exports = {
name: "queue",
description: "Show the music queue and now playing.",
execute(message) {
const serverQueue = message.client.queue.get(message.guild.id);
if (!serverQueue){
let queueEmbed = new MessageEmbed()
.setColor("#f9a825")
.setTitle("Queue")
.setDescription(`There is nothing playing right now.`)
return message.channel.send(queueEmbed).then((msg) => {
setTimeout(() => {
if(msg.deletable){
msg.delete();
}
}, 10000);
}).catch(console.error);
}
let queueEmbed = new MessageEmbed()
.setColor("#f9a825")
.setTitle("Queue")
.setDescription(`${serverQueue.songs.map((song, index) => index + 1 + ". **" + song.title + "**").join("\n")}
Now playing: **${serverQueue.songs[0].title}**`);
return message
.channel.send(queueEmbed).then((msg) => {
setTimeout(() => {
if(msg.deletable){
msg.delete();
}
}, 10000);
})
.catch(console.error);
}
};