From 3193b42e137b20bcce51b744eaee6b909d233e13 Mon Sep 17 00:00:00 2001 From: Ghellab Abderrahmane <43763935+rhaym-tech@users.noreply.github.com> Date: Tue, 8 Aug 2023 06:14:23 +0100 Subject: [PATCH] Cannot read properties of undefined (reading 'find') --- src/handlers/command.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers/command.js b/src/handlers/command.js index ae934f4f1..dd0ed1237 100644 --- a/src/handlers/command.js +++ b/src/handlers/command.js @@ -178,7 +178,7 @@ module.exports = { */ getSlashUsage(cmd) { let desc = ""; - if (cmd.slashCommand.options.find((o) => o.type === ApplicationCommandOptionType.Subcommand)) { + if (cmd.slashCommand.options?.find((o) => o.type === ApplicationCommandOptionType.Subcommand)) { const subCmds = cmd.slashCommand.options.filter((opt) => opt.type === ApplicationCommandOptionType.Subcommand); subCmds.forEach((sub) => { desc += `\`/${cmd.name} ${sub.name}\`\n❯ ${sub.description}\n\n`;