mirror of
https://github.com/musix-org/musix-oss
synced 2025-07-06 19:00:50 +00:00
31 lines
866 B
JavaScript
31 lines
866 B
JavaScript
module.exports = {
|
|
name: 'stop',
|
|
description: 'Stop the music and clear the queue.',
|
|
alias: ["none"],
|
|
usage: '',
|
|
permission: 'MANAGE_CHANNELS',
|
|
category: 'music control',
|
|
execute(msg, args, client, command) {
|
|
const queue = client.queue.get(msg.guild.id);
|
|
if (client.funcs.check(client, msg, command)) {
|
|
if (msg.content.includes("-force")) {
|
|
if (queue) {
|
|
queue.voiceChannel.leave();
|
|
queue.exists = false;
|
|
}
|
|
if (msg.guild.voice.channel) msg.guild.voice.channel.leave();
|
|
client.queue.delete(msg.guild.id);
|
|
return msg.channel.send(client.messages.stop);
|
|
}
|
|
if (!queue || !queue.playing) {
|
|
return msg.channel.send(client.messages.noServerQueue);
|
|
}
|
|
queue.songs = [];
|
|
queue.looping = false;
|
|
queue.endReason = "stop";
|
|
queue.connection.dispatcher.end();
|
|
msg.channel.send(client.messages.stop);
|
|
}
|
|
}
|
|
};
|