diff options
| author | s1n <[email protected]> | 2020-04-15 03:01:33 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-04-15 03:01:33 -0700 |
| commit | 44831cc8d8468e2d4f01f3adf64633f58ead6782 (patch) | |
| tree | 1fbdc404a6d4d8b6a8cd17cc26602b6e7d6c639e /src/commands/voice/resume.js | |
| parent | The Start (diff) | |
| parent | The Uwufication (diff) | |
| download | dep-core-44831cc8d8468e2d4f01f3adf64633f58ead6782.tar.xz dep-core-44831cc8d8468e2d4f01f3adf64633f58ead6782.zip | |
The Uwufication
Merge pull request #1 from 8cy/test
Diffstat (limited to 'src/commands/voice/resume.js')
| -rw-r--r-- | src/commands/voice/resume.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/commands/voice/resume.js b/src/commands/voice/resume.js new file mode 100644 index 0000000..1b28b28 --- /dev/null +++ b/src/commands/voice/resume.js @@ -0,0 +1,32 @@ +const { Command } = require('discord.js-commando'); +const emoji = require('emoji-random'); + +module.exports = class ResumeVoice extends Command { + constructor(client) { + super(client, { + name: 'resume', + group: 'voice', + memberName: 'resume', + description: 'Resumes audio of previously paused.', + guildOnly: true, + examples: ['uwu!resume'], + clientPermissions: ['SPEAK', 'CONNECT', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'], + }); + } + run(msg) { + var voiceChannel = msg.member.voice.channel; + if (!voiceChannel) return msg.reply('Please 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 any audio playing right now. ' + emoji.random()); + } + + msg.say('Song resumed :play_pause:'); + + msg.guild.musicData.songDispatcher.resume(); + } +};
\ No newline at end of file |