From d6cbfeffefd0d0d378660a886910d76e26f10d6f Mon Sep 17 00:00:00 2001 From: Zerio <43386412+ZerioDev@users.noreply.github.com> Date: Thu, 26 Nov 2020 22:10:44 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Update=20(v2.0.1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/filter.js | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/commands/filter.js b/commands/filter.js index 6da1c5b..930df4b 100644 --- a/commands/filter.js +++ b/commands/filter.js @@ -1,27 +1,23 @@ -const emotes = require("../config/emojis.json"); -const filters = require("../config/filters.json"); - exports.run = async (client, message, args) => { - if (!message.member.voice.channel) return message.channel.send(`You're not in a voice channel ${emotes.error}`); + if (!message.member.voice.channel) return message.channel.send(`${client.emotes.error} - You're not in a voice channel !`); - if (!client.player.getQueue(message)) return message.channel.send(`No songs currently playing ${emotes.error}`); + if (!client.player.getQueue(message)) return message.channel.send(`${client.emotes.error} - No songs currently playing !`); - const filter = args[0]; - if (!filter) return message.channel.send(`Please specify a valid filter to enable or disable ${emotes.error}`); + if (!args[0]) return message.channel.send(`${client.emotes.error} - Please specify a valid filter to enable or disable !`); - const filterToUpdate = Object.values(filters).find((f) => f.toLowerCase() === filter.toLowerCase()); + const filterToUpdate = Object.values(client.filters).find((f) => f.toLowerCase() === args[0].toLowerCase()); - if (!filterToUpdate) return message.channel.send(`This filter doesn't exist ${emotes.error}`); + if (!filterToUpdate) return message.channel.send(`${client.emotes.error} - This filter doesn't exist !`); - const filterRealName = Object.keys(filters).find((f) => filters[f] === filterToUpdate); + 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; client.player.setFilters(message, filtersUpdated); - if (filtersUpdated[filterRealName]) message.channel.send(`I'm **adding** the filter to the music, please wait... Note : the longer the music is, the longer this will take ${emotes.music}`); - else message.channel.send(`I'm **disabling** the filter on the music, please wait... Note : the longer the music is playing, the longer this will take ${emotes.music}`); + 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.`); + 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.`); };