Skip to content

Commit

Permalink
Fix slash command children in groups matching children with the same …
Browse files Browse the repository at this point in the history
…name (#81)
  • Loading branch information
Matyrobbrt authored Jun 10, 2024
1 parent a86d4de commit d07199e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -969,13 +969,13 @@ private SlashCommand findSlashCommand(String path)
case 2: // Slash command with children
// child check
for(SlashCommand cmd: command.getChildren())
if(cmd.isCommandFor(parts[1]))
if(cmd.isCommandFor(parts[1]) && cmd.getSubcommandGroup() == null)
return cmd;

return null;
case 3: // Slash command with a group and a child
for(SlashCommand cmd: command.getChildren())
if(cmd.isCommandFor(parts[2]) && cmd.getSubcommandGroup().getName().equals(parts[1]))
if(cmd.isCommandFor(parts[2]) && cmd.getSubcommandGroup() != null && cmd.getSubcommandGroup().getName().equals(parts[1]))
return cmd;

return null;
Expand Down

0 comments on commit d07199e

Please sign in to comment.