From 5fd238ea7964b36b9537d2f96e9a9c3aa019ba7a Mon Sep 17 00:00:00 2001 From: Wizzard Date: Sat, 17 Aug 2024 19:16:40 -0400 Subject: [PATCH] Update skip.js --- commands/skip.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/commands/skip.js b/commands/skip.js index 3171d25..fea1574 100644 --- a/commands/skip.js +++ b/commands/skip.js @@ -1,4 +1,4 @@ -const { skipTrack } = require('../utils/queueManager'); +const { skipTrack, getCurrentTrack, getQueue } = require('../utils/queueManager'); module.exports = { name: 'skip', @@ -11,6 +11,13 @@ module.exports = { return message.reply('You need to be in a voice channel to skip music!'); } + const currentTrack = getCurrentTrack(guildId); + const queue = getQueue(guildId); + + if (!currentTrack && queue.length === 0) { + return message.reply('There is no track currently playing or in the queue to skip!'); + } + skipTrack(guildId, voiceChannel); message.channel.send('Skipped the current track!'); }