DZ-Musicbot/commands/skip.js

18 lines
655 B
JavaScript
Raw Normal View History

2024-08-17 11:23:30 -04:00
const { skipTrack, getQueue, playNextInQueue } = require('../utils/queueManager');
2024-08-17 11:11:10 -04:00
module.exports = {
name: 'skip',
execute(message) {
2024-08-17 11:23:30 -04:00
const guildId = message.guild.id;
const queue = getQueue(guildId);
if (queue.length > 0) {
const voiceChannel = message.member.voice.channel;
const audioPlayer = playNextInQueue(guildId, voiceChannel); // Get the audio player
skipTrack(guildId, audioPlayer); // Skip the current track
message.channel.send('Skipped the current track!');
} else {
message.channel.send('There are no tracks to skip!');
}
2024-08-17 11:11:10 -04:00
}
2024-08-17 11:23:30 -04:00
};