Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include subcommands in the command handler page #772

Open
Hamburgergamer opened this issue Aug 6, 2021 · 2 comments
Open

Include subcommands in the command handler page #772

Hamburgergamer opened this issue Aug 6, 2021 · 2 comments
Labels
t: request Suggestion to add new or change existing content

Comments

@Hamburgergamer
Copy link

Problem:
Currently the command handler page is pretty similar to the old message command handler. I have the feeling, that there are some important aspects of slash commands, which are not covered in this guide. While the guide describes how to use multiple files for each commands, it explains nothing about how you should implement subcommands into your command handler. Do I need to put all subcommands from one command in one file? Is there a way to split them? These are just a few questions which I had in mind when I checked out the page. The examples also only show the parameters description: and name:. So for a beginner it is hard to know, if also the command options and defaultPermissions should be included in the command files. Furthermore I have the feeling that the content of the command handler section is sometimes a little bit contrary to the registering-slash-commands page. Can I store the data needed for registering the command data inside a command file or do I need to have it do it separately? Is there a way to include the registering of a command inside the command handler?
Overall I have the feeling, that the command handler page ignores some topics where new user would stumble on.

Solution:
Revise the command handler guide and include a section about how to include subcommands. In addition we could think about ways to include mechanics from other sections (Interactions) so it contains all possible hurdles, a developer could face when switching to slash commands.

Describe alternatives you've considered
If the requested content already exists on another page, we could add links to them in the command handler page, but I feel that this is more a general problem of the command handler page.

Additional notes
I did not have the time yet to work with slash commands by myself so I wasn't able to test any possible solutions. Therefore I decided to create a feature request first as some other users would also like to have more insights on the command handler.

@Hamburgergamer Hamburgergamer added the t: request Suggestion to add new or change existing content label Aug 6, 2021
@MattA-Official
Copy link

So, a link to the Discord API regarding how to structure the data for using subcommands does exist on the page. A section with details on how to use the CommandInteractionOptionResolver with subcommands has been added in line with #754.

@Hamburgergamer
Copy link
Author

@MattA-Official yeah #754 already solves some of the issues. Nice to see that it was merged so quickly. I guess the whole deployement discussions also lead to some confusion on my side. I am currently figuring out, what is the best way to deal with sub commands in your command file. Personally I really hate files with hundred lines of code. If you are including the command data (options etc) as well as the different subcommand functions / conditions, in one command file, it gets quite messy. Therefore I am currently splitting these parts in different files. If anyone has a nice solution / structure for that, it would be nice to also have it in the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: request Suggestion to add new or change existing content
Projects
None yet
Development

No branches or pull requests

2 participants