aboutsummaryrefslogtreecommitdiff
path: root/commands/voice/loopc.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/loopc.js
parentfix join, v1.1.1 (diff)
downloadminecraftsoundtrackbot-test.tar.xz
minecraftsoundtrackbot-test.zip
testtest
Diffstat (limited to 'commands/voice/loopc.js')
-rw-r--r--commands/voice/loopc.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/commands/voice/loopc.js b/commands/voice/loopc.js
new file mode 100644
index 0000000..507b424
--- /dev/null
+++ b/commands/voice/loopc.js
@@ -0,0 +1,32 @@
+const { Command } = require('discord.js-commando');
+const emoji = require('emoji-random');
+
+module.exports = class LoopVoice extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'loop',
+ aliases: ['repeat'],
+ group: 'voice',
+ memberName: 'loop',
+ description: 'Loops the soundtrack.',
+ guildOnly: true,
+ examples: ['msb!loop', 'msb!repeat']
+ });
+ }
+ run(msg) {
+ var voiceChannel = msg.member.voice.channel;
+ if (!voiceChannel) return msg.reply('Join a voice 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());
+ }
+ msg.channel.send(
+ 'Looping the soundtrack ' + emoji.random()
+ );
+ msg.guild.musicData.queue.unshift(msg.guild.musicData.nowPlaying);
+ return;
+ }
+}; \ No newline at end of file