Update skip.js

This commit is contained in:
Wizzard 2024-08-17 19:16:40 -04:00
parent 4c7e30db45
commit 5fd238ea79
1 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,4 @@
const { skipTrack } = require('../utils/queueManager'); const { skipTrack, getCurrentTrack, getQueue } = require('../utils/queueManager');
module.exports = { module.exports = {
name: 'skip', name: 'skip',
@ -11,6 +11,13 @@ module.exports = {
return message.reply('You need to be in a voice channel to skip music!'); 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); skipTrack(guildId, voiceChannel);
message.channel.send('Skipped the current track!'); message.channel.send('Skipped the current track!');
} }