Skip to content

Commit

Permalink
Merge pull request #406 from rhaym-tech/rhaym-tech-patch-1
Browse files Browse the repository at this point in the history
Fix /help: Cannot read properties of undefined (reading 'find')
  • Loading branch information
saiteja-madha authored Feb 5, 2024
2 parents bb0d574 + 3193b42 commit 84eb4a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down

0 comments on commit 84eb4a8

Please sign in to comment.