diff options
| author | 8cy <[email protected]> | 2020-04-13 05:32:35 -0700 |
|---|---|---|
| committer | 8cy <[email protected]> | 2020-04-13 05:32:35 -0700 |
| commit | 9dff52f7d047c905326bc2f476ede5463e00f2a0 (patch) | |
| tree | 1fec8563b3b72fde9b2ab7ad9e56a97398798685 /src/commands/voice/loop.js | |
| parent | typescript (diff) | |
| download | s5nical-9dff52f7d047c905326bc2f476ede5463e00f2a0.tar.xz s5nical-9dff52f7d047c905326bc2f476ede5463e00f2a0.zip | |
typescript final
Diffstat (limited to 'src/commands/voice/loop.js')
| -rw-r--r-- | src/commands/voice/loop.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/commands/voice/loop.js b/src/commands/voice/loop.js new file mode 100644 index 0000000..3679b4f --- /dev/null +++ b/src/commands/voice/loop.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 currently playing audio', + guildOnly: true, + examples: ['s5n!loop', 's5n!repeat'] + }); + } + 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('there isn\'t a song playing right now lol ' + emoji.random()); + } + msg.channel.send( + `${msg.guild.musicData.nowPlaying.title} added to queue ` + emoji.random() + ); + msg.guild.musicData.queue.unshift(msg.guild.musicData.nowPlaying); + return; + } +};
\ No newline at end of file |