Merge pull request #261 from archubbuck/patch-1

Adds support for slash commands with no options
This commit is contained in:
Cinnamon 2022-08-18 11:24:25 +07:00 committed by GitHub
commit 8082ade700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -738,7 +738,7 @@ class ApplicationCommand extends Base {
'is not a valid sub command', 'is not a valid sub command',
); );
} }
const valueRequired = subCommand.options.filter(o => o.required).length; const valueRequired = subCommand.options?.filter(o => o.required).length;
for (let i = 0; i < options.length; i++) { for (let i = 0; i < options.length; i++) {
const optionInput = subCommand.options[i]; const optionInput = subCommand.options[i];
const value = options[i]; const value = options[i];