-
Notifications
You must be signed in to change notification settings - Fork 0
/
resume.js
30 lines (27 loc) · 901 Bytes
/
resume.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
module.exports = {
name: "resume",
description: "Resume currently playing music",
execute(message) {
const serverQueue = message.client.queue.get(message.guild.id);
if (!message.member.voice.channel)
return message.reply("You need to join a voice channel first!").catch(console.error);
if (serverQueue && !serverQueue.playing) {
serverQueue.playing = true;
serverQueue.connection.dispatcher.resume();
let resumeEmbed = new MessageEmbed()
.setTitle("Resume")
.setDescription(`The music has been resumed by ${message.author}`)
.setColor(`#388e3c`);
return serverQueue.textChannel.send(resumeEmbed)
.then((msg) => {
setTimeout(() => {
if (msg.deletable) {
msg.delete();
}
}, 10000);
})
.catch(console.error);;
}
return message.reply("There is nothing playing.").catch(console.error);
}
};