From b754444d3204dbf0cbbfc8fde2457f8168c31a6c Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 28 Jul 2022 22:28:38 +0300 Subject: [PATCH] woops --- src/structure/components/observers/CommandHandler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/structure/components/observers/CommandHandler.js b/src/structure/components/observers/CommandHandler.js index 1dd53de..c29f3c1 100644 --- a/src/structure/components/observers/CommandHandler.js +++ b/src/structure/components/observers/CommandHandler.js @@ -221,7 +221,7 @@ class CommandHandler extends Observer { continue; } - if (matched.guildOnly) return { error: true, params: { option: matched.name }, index: 'O_COMMANDHANDLER_GUILDONLY_OPT' }; + if (matched.guildOnly && !guild) return { error: true, params: { option: matched.name }, index: 'O_COMMANDHANDLER_GUILDONLY_OPT' }; const rawValue = matched.plural && typeof option.value === 'string' ? Util.parseQuotes(option.value).map(([x]) => x) : option.value; const newOption = matched.clone(rawValue, guild, true); const parsed = await newOption.parse(); @@ -321,7 +321,7 @@ class CommandHandler extends Observer { return f.name === _flag || aliased; }); if (!flag) return { error: true, index: 'O_COMMANDHANDLER_UNRECOGNISED_FLAG', params: { flag: _flag } }; - else if (flag.guildOnly) return { error: true, params: { option: flag.name }, index: 'O_COMMANDHANDLER_GUILDONLY_OPT' }; + else if (flag.guildOnly && !guild) return { error: true, params: { option: flag.name }, index: 'O_COMMANDHANDLER_GUILDONLY_OPT' }; // console.log('aliased', aliased); params.splice(index, 1, null);