diff options
Diffstat (limited to 'commands/voice/resume.cjs')
| -rw-r--r-- | commands/voice/resume.cjs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/commands/voice/resume.cjs b/commands/voice/resume.cjs new file mode 100644 index 0000000..a3f32ce --- /dev/null +++ b/commands/voice/resume.cjs @@ -0,0 +1,31 @@ +const { Command } = require('discord.js-commando'); +const emoji = require('emoji-random'); + +module.exports = class ResumeVoice extends Command { + constructor(client) { + super(client, { + name: 'resume', + aliases: ['unpause'], + group: 'voice', + memberName: 'resume', + description: 'Resumes the soundtrack if paused.', + guildOnly: true, + examples: ['msb!resume', 'msb!unpause'] + }); + } + 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()); + } + + msg.say('Soundtrack resumed :play_pause:'); + + msg.guild.musicData.songDispatcher.resume(); + } +};
\ No newline at end of file |