From 536d234c40d3964b1b543edbe04f273764f0fc02 Mon Sep 17 00:00:00 2001 From: Navy Date: Mon, 10 May 2021 23:23:52 +0300 Subject: [PATCH] protectiontype alias + resolve for 'roles' --- .../components/settings/administration/Protection.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/structure/client/components/settings/administration/Protection.js b/structure/client/components/settings/administration/Protection.js index c98645b..4e63a1b 100644 --- a/structure/client/components/settings/administration/Protection.js +++ b/structure/client/components/settings/administration/Protection.js @@ -8,6 +8,9 @@ class ProtectionSetting extends Setting { name: 'protection', module: 'administration', usage: "<'type'|'add'|'remove'> <'role'|'position'|role..>", + aliases: [ + 'protectiontype' + ], examples: [ 'protection type ', 'protection add ', @@ -36,15 +39,16 @@ class ProtectionSetting extends Setting { const langParams = {}; - if (method === 'type') { + if (method === 'type' || message._caller === 'protectiontype') { if (!params[1]) return { error: true, msg: message.format('MISSING_ARGS') }; - const value = params[1].toLowerCase(); - if (!['role', 'position'].includes(value)) return { error: true, msg: message.format('S_PROTECTION_INVALID_ARGS') }; + let value = params[1].toLowerCase(); + if (!['role', 'roles', 'position'].includes(value)) return { error: true, msg: message.format('S_PROTECTION_INVALID_ARGS') }; + if (value === 'roles') value = 'role'; setting.type = value; index = 'S_PROTECTION_TYPE';