summaryrefslogtreecommitdiff
path: root/commands/voice/skipall.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands/voice/skipall.js')
-rw-r--r--commands/voice/skipall.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/commands/voice/skipall.js b/commands/voice/skipall.js
new file mode 100644
index 0000000..bce9852
--- /dev/null
+++ b/commands/voice/skipall.js
@@ -0,0 +1,29 @@
+const { Command } = require('discord.js-commando');
+
+module.exports = class SkipAllVoice extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'skipall',
+ group: 'voice',
+ memberName: 'skipall',
+ description: 'skip all songs in the queue',
+ guildOnly: true
+ });
+ }
+ run(msg) {
+ var voiceChannel = msg.member.voice.channel;
+ if (!voiceChannel) return msg.reply('join a channel and try again');
+
+ if (
+ typeof msg.guild.musicData.songDispatcher == 'undefined' ||
+ msg.guild.musicData.songDispatcher == null
+ ) {
+ return msg.reply('there is no song playing right now');
+ }
+ if (!msg.guild.musicData.queue)
+ return msg.say('there are no songs in queue now >:)');
+ msg.guild.musicData.songDispatcher.end();
+ msg.guild.musicData.queue.length = 0; // clear queue
+ return;
+ }
+}; \ No newline at end of file