✨ Bug fixes & update (v5.0.0)
This commit is contained in:
@@ -11,6 +11,8 @@ module.exports = {
|
||||
|
||||
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
|
||||
|
||||
if (client.player.getQueue(message).tracks.length <= 1) return message.channel.send(`${client.emotes.error} - There is only one song in the queue.`);
|
||||
|
||||
client.player.clearQueue(message);
|
||||
|
||||
message.channel.send(`${client.emotes.success} - The queue has just been **removed** !`);
|
||||
|
||||
@@ -4,19 +4,29 @@ module.exports = {
|
||||
category: 'Music',
|
||||
utilisation: '{prefix}loop',
|
||||
|
||||
execute(client, message) {
|
||||
execute(client, message, args) {
|
||||
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
|
||||
|
||||
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
|
||||
|
||||
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
|
||||
|
||||
if (client.player.getQueue(message).repeatMode) {
|
||||
client.player.setRepeatMode(message, false);
|
||||
return message.channel.send(`${client.emotes.success} - Repeat mode **disabled** !`);
|
||||
if (args.join(" ").toLowerCase() === 'queue') {
|
||||
if (client.player.getQueue(message).loopMode) {
|
||||
client.player.setLoopMode(message, false);
|
||||
return message.channel.send(`${client.emotes.success} - Repeat mode **disabled** !`);
|
||||
} else {
|
||||
client.player.setLoopMode(message, true);
|
||||
return message.channel.send(`${client.emotes.success} - Repeat mode **enabled** the whole queue will be repeated endlessly !`);
|
||||
};
|
||||
} else {
|
||||
client.player.setRepeatMode(message, true);
|
||||
return message.channel.send(`${client.emotes.success} - Repeat mode **enabled** !`);
|
||||
if (client.player.getQueue(message).repeatMode) {
|
||||
client.player.setRepeatMode(message, false);
|
||||
return message.channel.send(`${client.emotes.success} - Repeat mode **disabled** !`);
|
||||
} else {
|
||||
client.player.setRepeatMode(message, true);
|
||||
return message.channel.send(`${client.emotes.success} - Repeat mode **enabled** the current music will be repeated endlessly !`);
|
||||
};
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -11,6 +11,6 @@ module.exports = {
|
||||
|
||||
if (!args[0]) return message.channel.send(`${client.emotes.error} - Please indicate the title of a song !`);
|
||||
|
||||
client.player.play(message, args.join(" "));
|
||||
client.player.play(message, args.join(" "), { firstResult: true });
|
||||
},
|
||||
};
|
||||
@@ -13,7 +13,7 @@ module.exports = {
|
||||
|
||||
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No songs currently playing !`);
|
||||
|
||||
message.channel.send(`**Server queue - ${message.guild.name} ${client.emotes.queue}**\nCurrent : ${queue.playing.title} | ${queue.playing.author}\n\n` + (queue.tracks.map((track, i) => {
|
||||
message.channel.send(`**Server queue - ${message.guild.name} ${client.emotes.queue} ${client.player.getQueue(message).loopMode ? '(looped)' : ''}**\nCurrent : ${queue.playing.title} | ${queue.playing.author}\n\n` + (queue.tracks.map((track, i) => {
|
||||
return `**#${i + 1}** - ${track.title} | ${track.author} (requested by : ${track.requestedBy.username})`
|
||||
}).slice(0, 5).join('\n') + `\n\n${queue.tracks.length > 5 ? `And **${queue.tracks.length - 5}** other songs...` : `In the playlist **${queue.tracks.length}** song(s)...`}`));
|
||||
},
|
||||
|
||||
16
commands/music/search.js
Normal file
16
commands/music/search.js
Normal file
@@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
name: 'search',
|
||||
aliases: ['sr'],
|
||||
category: 'Music',
|
||||
utilisation: '{prefix}search [name/URL]',
|
||||
|
||||
execute(client, message, args) {
|
||||
if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`);
|
||||
|
||||
if (message.guild.me.voice.channel && message.member.voice.channel.id !== message.guild.me.voice.channel.id) return message.channel.send(`${client.emotes.error} - You are not in the same voice channel !`);
|
||||
|
||||
if (!args[0]) return message.channel.send(`${client.emotes.error} - Please indicate the title of a song !`);
|
||||
|
||||
client.player.play(message, args.join(" "));
|
||||
},
|
||||
};
|
||||
@@ -15,7 +15,7 @@ module.exports = {
|
||||
|
||||
if (Math.round(parseInt(args[0])) < 1 || Math.round(parseInt(args[0])) > 100) return message.channel.send(`${client.emotes.error} - Please enter a valid number (between 1 and 100) !`);
|
||||
|
||||
client.player.setVolume(message, args[0]);
|
||||
client.player.setVolume(message, parseInt(args[0]));
|
||||
|
||||
message.channel.send(`${client.emotes.success} - Volume set to **${parseInt(args[0])}%** !`);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user