Skip to content

Commit

Permalink
Fixed first level subcommand registration (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
Plytas authored Jun 28, 2024
1 parent d4c31f4 commit b4c34de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/DiscordCommandRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function register(): void
$subCommandGroupDescription = (new $subCommandGroup)->description();
}

$subCommandGroups[] = DiscordApplicationCommandOption::new(name: $subGroupName, type: CommandOptionType::SUB_COMMAND_GROUP)
$subCommandGroups[] = DiscordApplicationCommandOption::new(name: $subGroupName, type: ($subCommands === []) ? CommandOptionType::SUB_COMMAND : CommandOptionType::SUB_COMMAND_GROUP)
->setDescription($subCommandGroupDescription)
->setOptions(($subCommands === []) ? null : DiscordApplicationCommandOption::collect(collect($subCommands)));
}
Expand Down

0 comments on commit b4c34de

Please sign in to comment.