Bug fixes & update (v4.0.0)

This commit is contained in:
Zerio
2020-12-21 23:52:02 +01:00
parent db26c1faa6
commit 109e1051e5
17 changed files with 77 additions and 114 deletions

View File

@@ -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.`);
},
};