From 45833027998d64622692632403ef0018a83327f3 Mon Sep 17 00:00:00 2001 From: Navy Date: Sat, 11 Jul 2020 23:40:25 +0300 Subject: [PATCH] premium and exact matching --- structure/client/components/commands/utility/Settings.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/structure/client/components/commands/utility/Settings.js b/structure/client/components/commands/utility/Settings.js index 8360136..06d59e6 100644 --- a/structure/client/components/commands/utility/Settings.js +++ b/structure/client/components/commands/utility/Settings.js @@ -68,7 +68,7 @@ class SettingsCommand extends Command { return await this._handleReset(prompt, message, type); } - const settings = this.client.resolver.components(target, 'setting', false).sort(c=>c.resolve === type); + const settings = this.client.resolver.components(target, 'setting', true).sort(c=>c.resolve === type); const [ setting ] = settings; if(!setting) { await message.respond(message.format('C_SETTINGS_NONEXISTANT'), { emoji: 'failure' }); @@ -98,6 +98,8 @@ class SettingsCommand extends Command { return message.respond(msg, { emoji: 'success' }); } + if (setting.premium > message.guild.premium) return message.formattedRespond('PREMIUM_REQUIRED', { emoji: 'failure', params: { tier: message.guild.premium, required: setting.premium } }); + const response = await setting.handle(message, parameters); if(response.ignore) return undefined; message.respond(response.msg, { emoji: response.error ? 'failure' : 'success', embed: response.embed || null });