Adds support for slash commands with no options

This commit is contained in:
Adam Chubbuck 2022-08-17 21:26:25 -04:00 committed by GitHub
parent 666cddf9f0
commit 80278d3e0d
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',
);
}
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++) {
const optionInput = subCommand.options[i];
const value = options[i];