Chew / JDA-Chewtils

Chew's fork of JDA-Applications/JDA-Utilities, with support for modern features such as Slash Commands, Context Menus, and more.

Home Page:https://chew.pro/JDA-Chewtils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Children of Slash Command does not show up if the Command it self is a child of another command

ZeyoYT opened this issue · comments

commented

Issue Checklist

  • I have checked for similar issues on the Issue tracker
  • I have updated to the latest version of JDA-Chewtils.
  • I have checked the branches or the maintainer's PRs for upcoming bug fixes.

Affected Modules

Command

Description

Issue :-

I Recently was trying out a system in my bot that is made for server mods

i have a command(child) which has 3 children commands with options, i have another command called server(parent) which contains sub commands for all server related commands, the parent command showed child command but none of the child's children commands

how to reproduce :-

  1. Make 3 slash commands ( X, Y and Z )
  2. Add Z as a child command of Y using children
  3. Add Y as a child command of X using children
  4. Add X command to Bot and also add Y command to Bot

outcome :-
X Command has Y but not Z
Y Command has Z Command

commented

This seems like a fundamental misunderstanding of how Discord slash commands work.

See: https://discord.com/developers/docs/interactions/application-commands#subcommands-and-subcommand-groups

Parents cannot be executed if they have children, so what you're experiencing is intended behavior. The closest you can get here is making X command have a group called A, and have Z be a child of A, so X has A (who has Z) and Y, 2 children, 3 layers, as you're seemingly wanting.

Can you describe your use case? I can probably help get you to what you're wanting.

commented

oh i see my bad, i am working on a reaction role system, in my bot i have a sub command called server which has other server realted slash command, like auto role, ticket system etc, all of this commands dont have a child they work directly by showing select menu , but when i made the reaction role command which has 3 children, 1. set, 2. add role, 3.disable

while i can just skip adding reaction role as a child of server command, it would great if it was under server command as all of server realted commands are inside it

i might aswell just remove the server command as its not future proof

commented

Yeah, and it'd mess with your permissions as well. You could easily add a /help and auto-complete (or uses Choices) all of your commands to describe them as well. Glad I could help you :)