diff options
| author | 8cy <[email protected]> | 2020-04-10 10:16:53 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-10 10:16:53 -0700 |
| commit | 4b308538961facb87d73fafeab7fab5927562eff (patch) | |
| tree | 8eaf88c074c379d76e7932e6fc3f32c05adb70ca /commands/voice/loop.js | |
| parent | rework reboot, work on itemshop, v1.5.2 (diff) | |
| download | s5nical-4b308538961facb87d73fafeab7fab5927562eff.tar.xz s5nical-4b308538961facb87d73fafeab7fab5927562eff.zip | |
port to commando/ v12, 2.0.0
ported everything over to v12 and then commando in the span of 2 days no sleep lol. also now using typescript standard for cool 8)
Diffstat (limited to 'commands/voice/loop.js')
| -rw-r--r-- | commands/voice/loop.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/commands/voice/loop.js b/commands/voice/loop.js new file mode 100644 index 0000000..64c586e --- /dev/null +++ b/commands/voice/loop.js @@ -0,0 +1,29 @@ +const { Command } = require('discord.js-commando'); + +module.exports = class LoopVoice extends Command { + constructor(client) { + super(client, { + name: 'loop', + group: 'voice', + memberName: 'loop', + description: 'loops currently playing audio', + 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 isn\'t a song playing right now lol'); + } + msg.channel.send( + `${msg.guild.musicData.nowPlaying.title} added to queue` + ); + msg.guild.musicData.queue.unshift(msg.guild.musicData.nowPlaying); + return; + } +};
\ No newline at end of file |