koply / KCommando

Annotation-based multifunctional command handler framework for JDA & Javacord.
GNU General Public License v3.0
47 stars 7 forks source link

Ability to create subcommands #15

Open PillageDev opened 2 months ago

PillageDev commented 2 months ago

Is your feature request related to a problem? Please describe. Not able to create subcommands like you are in JDA. For example:

GuildUtils.getGuild().upsertCommand("manage", "Manage settings")
                .addSubcommands(
                        new SubcommandData("cooldown", "Manage user cooldowns")
                                .addOptions(
                                        new OptionData(OptionType.STRING, "gamemode", "The game mode you want to test the user in", true)
                                                .addChoices(Constants.ALL_GAMEMODE_CHOICES)
                                )
                                .addOptions(new OptionData(OptionType.USER, "user", "The user you want to manage", true))
                                .addOptions(new OptionData(OptionType.STRING, "action", "The action you want to perform", true)
                                        .addChoices(
                                                new Command.Choice("Terminate", "terminate"),
                                                new Command.Choice("Shorten", "Shorten"),
                                                new Command.Choice("Lengthen", "lengthen")
                                        )
                                )
                                .addOptions(new OptionData(OptionType.INTEGER, "amount", "The amount you want to shorten or lengthen the cooldown by", false))
                )

Describe the solution you'd like Creating a command group on the initialization of the integration, like:


JDAIntegration commandIntegration = new JDAIntegration(jda);
KCommando commando = new KCommando(commandIntegration)
        ......
        .addCommandGroup(new CommandGroup("group 1", "desc for group 1"))

**Describe alternatives you've considered**
Using plain JDA

**Additional context**
None
PillageDev commented 2 months ago

16