summaryrefslogtreecommitdiff
path: root/src/commands/voice/pause.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/voice/pause.js')
-rw-r--r--src/commands/voice/pause.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/commands/voice/pause.js b/src/commands/voice/pause.js
new file mode 100644
index 0000000..6ab6fb0
--- /dev/null
+++ b/src/commands/voice/pause.js
@@ -0,0 +1,32 @@
+const { Command } = require('discord.js-commando');
+const emoji = require('emoji-random');
+
+module.exports = class PauseVoice extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'pause',
+ group: 'voice',
+ memberName: 'pause',
+ description: 'Pauses audio of previously playing.',
+ guildOnly: true,
+ examples: ['uwu!pause'],
+ 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 paused :pause_button:');
+
+ msg.guild.musicData.songDispatcher.pause();
+ }
+}; \ No newline at end of file