-
Notifications
You must be signed in to change notification settings - Fork 0
/
skip.js
31 lines (26 loc) · 908 Bytes
/
skip.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
const { MessageEmbed } = require('discord.js');
module.exports = {
name: "skip",
description: "Skip the currently playing song",
async 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)
return message.channel.send("There is nothing playing that I could skip for you.").catch(console.error);
serverQueue.connection.dispatcher.end();
let skippedEmbed = new MessageEmbed()
.setTitle("Skipped")
.setDescription(`The song has been skipped by ${message.author}`)
.setColor(`#fbc02d`);
serverQueue.textChannel.send(skippedEmbed)
.then((msg) => {
setTimeout(() => {
if (msg.deletable) {
msg.delete();
}
}, 10000);
})
.catch(console.error);
}
};