26 lines
968 B
JavaScript
26 lines
968 B
JavaScript
const { SlashCommandBuilder, PermissionsBitField } = require('discord.js');
|
|
const { useQueue } = require("discord-player");
|
|
|
|
const informationStatus = "[INFO]: ";
|
|
const warningStatus = "[WARNING]: ";
|
|
const errorStatus = "[ERROR]: ";
|
|
|
|
module.exports = {
|
|
data: new SlashCommandBuilder()
|
|
.setName('skip')
|
|
.setDescription('Skips the current track.'),
|
|
async execute(interaction) {
|
|
const queue = useQueue(interaction.guild.id);
|
|
|
|
if(!interaction.member.permissions.has(PermissionsBitField.Flags.ManageMessages)) return interaction.reply({ content: "<:xmark:1238963594758979736> You dont have permission to use this command", ephemeral: true });
|
|
|
|
try{
|
|
await queue.node.skip();
|
|
return interaction.reply("<:checkmark:1238964552482422844> Current song has been skipped.");
|
|
} catch(error) {
|
|
interaction.reply({ content: "Something went wrong, try again later.", ephemeral: true });
|
|
return console.log(error);
|
|
}
|
|
}
|
|
}
|