aboutsummaryrefslogtreecommitdiff
path: root/commands/voice/skipallc.js
diff options
context:
space:
mode:
author8cy <[email protected]>2020-04-13 03:54:31 -0700
committer8cy <[email protected]>2020-04-13 03:54:31 -0700
commit3733f7575faba8a06cc65c8eaf3612f80f46a44b (patch)
treea9ecd915e5749b960efbae5dd32307b9f998428c /commands/voice/skipallc.js
parentfix join, v1.1.1 (diff)
downloadminecraftsoundtrackbot-test.tar.xz
minecraftsoundtrackbot-test.zip
testtest
Diffstat (limited to 'commands/voice/skipallc.js')
-rw-r--r--commands/voice/skipallc.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/commands/voice/skipallc.js b/commands/voice/skipallc.js
new file mode 100644
index 0000000..32800b1
--- /dev/null
+++ b/commands/voice/skipallc.js
@@ -0,0 +1,42 @@
+const { Command } = require('discord.js-commando');
+const emoji = require('emoji-random');
+
+module.exports = class SkipAllVoice extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'skipall',
+ aliases: [
+ 'endqueue',
+ 'endq',
+ 'skipqueue',
+ 'skipq'
+ ],
+ group: 'voice',
+ memberName: 'skipall',
+ description: 'Skips all the songs in the soundtrack queue.',
+ guildOnly: true,
+ examples: [
+ 'msb!endqueue',
+ 'msb!endq',
+ 'msb!skipqueue',
+ 'msb!skipq'
+ ]
+ });
+ }
+ run(msg) {
+ var voiceChannel = msg.member.voice.channel;
+ if (!voiceChannel) return msg.reply('Join a channel and try again. ' + emoji.random());
+
+ if (
+ typeof msg.guild.musicData.songDispatcher == 'undefined' ||
+ msg.guild.musicData.songDispatcher == null
+ ) {
+ return msg.reply('The soundtrack isn\'t playing right now. ' + emoji.random());
+ }
+ if (!msg.guild.musicData.queue)
+ return msg.say('This is the only song in the soundtrack queue. ' + emoji.random());
+ msg.guild.musicData.songDispatcher.end();
+ msg.guild.musicData.queue.length = 0; // clear queue
+ return;
+ }
+}; \ No newline at end of file