This commit is contained in:
Erik 2022-07-28 22:28:38 +03:00
parent 9453c6ae10
commit b754444d32
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -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);