summaryrefslogtreecommitdiff
path: root/src/commands/voice/skip.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/voice/skip.ts')
-rw-r--r--src/commands/voice/skip.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/commands/voice/skip.ts b/src/commands/voice/skip.ts
new file mode 100644
index 0000000..c8c4c62
--- /dev/null
+++ b/src/commands/voice/skip.ts
@@ -0,0 +1,29 @@
+import { Command, CommandoMessage } from 'discord.js-commando';
+import emoji from 'emoji-random';
+
+module.exports = class SkipVoice extends Command {
+ constructor(client) {
+ super(client, {
+ name: 'skip',
+ group: 'voice',
+ memberName: 'skip',
+ description: 'Skips one song ahead in the current queue.',
+ guildOnly: true,
+ examples: ['uwu!skip'],
+ clientPermissions: ['SPEAK', 'CONNECT', 'SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY'],
+ });
+ }
+ run(msg: CommandoMessage) {
+ const 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.guild.musicData.songDispatcher.end();
+ }
+}; \ No newline at end of file