✨ Bug fixes & update (v4.0.0)
This commit is contained in:
@@ -13,18 +13,17 @@ module.exports = {
|
||||
|
||||
if (!args[0]) return message.channel.send(`${client.emotes.error} - Please specify a valid filter to enable or disable !`);
|
||||
|
||||
const filterToUpdate = Object.values(client.filters).find((f) => f.toLowerCase() === args[0].toLowerCase());
|
||||
const filterToUpdate = client.filters.find((x) => x.toLowerCase() === args[0].toLowerCase());
|
||||
|
||||
if (!filterToUpdate) return message.channel.send(`${client.emotes.error} - This filter doesn't exist !`);
|
||||
if (!filterToUpdate) return message.channel.send(`${client.emotes.error} - This filter doesn't exist, try for example (8D, vibrato, pulsator...) !`);
|
||||
|
||||
const filterRealName = Object.keys(client.filters).find((f) => client.filters[f] === filterToUpdate);
|
||||
|
||||
const queueFilters = client.player.getQueue(message).filters;
|
||||
const filtersUpdated = {};
|
||||
filtersUpdated[filterRealName] = queueFilters[filterRealName] ? false : true;
|
||||
|
||||
filtersUpdated[filterToUpdate] = client.player.getQueue(message).filters[filterToUpdate] ? false : true;
|
||||
|
||||
client.player.setFilters(message, filtersUpdated);
|
||||
|
||||
if (filtersUpdated[filterRealName]) message.channel.send(`${client.emotes.music} - I'm **adding** the filter to the music, please wait... Note : the longer the music is, the longer this will take.`);
|
||||
if (filtersUpdated[filterToUpdate]) message.channel.send(`${client.emotes.music} - I'm **adding** the filter to the music, please wait... Note : the longer the music is, the longer this will take.`);
|
||||
else message.channel.send(`${client.emotes.music} - I'm **disabling** the filter on the music, please wait... Note : the longer the music is playing, the longer this will take.`);
|
||||
},
|
||||
};
|
||||
@@ -14,9 +14,7 @@ module.exports = {
|
||||
const track = client.player.nowPlaying(message);
|
||||
const filters = [];
|
||||
|
||||
Object.keys(client.player.getQueue(message).filters).forEach((filterName) => {
|
||||
if (client.player.getQueue(message).filters[filterName]) filters.push(filterName);
|
||||
});
|
||||
Object.keys(client.player.getQueue(message).filters).forEach((filterName) => client.player.getQueue(message).filters[filterName]) ? filters.push(filterName) : false;
|
||||
|
||||
message.channel.send({
|
||||
embed: {
|
||||
@@ -30,7 +28,7 @@ module.exports = {
|
||||
|
||||
{ name: 'Views', value: track.views, inline: true },
|
||||
{ name: 'Duration', value: track.duration, inline: true },
|
||||
{ name: 'Filters activated', value: filters.length, inline: true },
|
||||
{ name: 'Filters activated', value: filters.length + '/' + client.filters.length, inline: true },
|
||||
|
||||
{ name: 'Volume', value: client.player.getQueue(message).volume, inline: true },
|
||||
{ name: 'Repeat mode', value: client.player.getQueue(message).repeatMode ? 'Yes' : 'No', inline: true },
|
||||
|
||||
@@ -15,6 +15,6 @@ module.exports = {
|
||||
|
||||
client.player.pause(message);
|
||||
|
||||
message.channel.send(`${client.emotes.success} - Song ${client.player.getQueue(message).playing.title} **paused** !`);
|
||||
message.channel.send(`${client.emotes.success} - Song ${client.player.getQueue(message).playing.title} paused !`);
|
||||
},
|
||||
};
|
||||
@@ -15,6 +15,6 @@ module.exports = {
|
||||
|
||||
client.player.resume(message);
|
||||
|
||||
message.channel.send(`${client.emotes.success} - Song ${client.player.getQueue(message).playing.title} **resumed** !`);
|
||||
message.channel.send(`${client.emotes.success} - Song ${client.player.getQueue(message).playing.title} resumed !`);
|
||||
},
|
||||
};
|
||||
@@ -11,14 +11,11 @@ module.exports = {
|
||||
|
||||
if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No music currently playing !`);
|
||||
|
||||
const disabledEmoji = client.emotes.error;
|
||||
const enabledEmoji = client.emotes.success;
|
||||
|
||||
const filtersStatuses = [[], []];
|
||||
|
||||
Object.keys(client.filters).forEach((filterName) => {
|
||||
client.filters.forEach((filterName) => {
|
||||
const array = filtersStatuses[0].length > filtersStatuses[1].length ? filtersStatuses[1] : filtersStatuses[0];
|
||||
array.push(client.filters[filterName] + " : " + (client.player.getQueue(message).filters[filterName] ? enabledEmoji : disabledEmoji));
|
||||
array.push(filterName.charAt(0).toUpperCase() + filterName.slice(1) + " : " + (client.player.getQueue(message).filters[filterName] ? client.emotes.success : client.emotes.off));
|
||||
});
|
||||
|
||||
message.channel.send({
|
||||
@@ -30,7 +27,7 @@ module.exports = {
|
||||
{ name: '** **', value: filtersStatuses[1].join('\n'), inline: true },
|
||||
],
|
||||
timestamp: new Date(),
|
||||
description: `List of all filters enabled or disabled.\nUse \`${client.config.prefix}filter\` to add a filter to a song.`,
|
||||
description: `List of all filters enabled or disabled.\nUse \`${client.config.discord.prefix}filter\` to add a filter to a song.`,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user