Add the ability to use slash commands#17
Closed
arthurmelton wants to merge 4 commits intoBigBoot:masterfrom
Closed
Add the ability to use slash commands#17arthurmelton wants to merge 4 commits intoBigBoot:masterfrom
arthurmelton wants to merge 4 commits intoBigBoot:masterfrom
Conversation
added 2 commits
May 10, 2023 21:12
Collaborator
Author
|
Let me do more testing tonight, I think this might actually do some things wrong. I also found out how to delete all of the slash commands for testing. |
Collaborator
Author
|
I did some testing and this should be ready to get. |
Collaborator
Author
|
Wait, I actually did find a bug with it. I will try and fix it by tonight. |
Collaborator
Author
|
Ok, looking at the discord documentation there is no possibility to have a command that is higher than 3 deep. We could have commands like this
We could not do the following
I will close this pull request as I don't think it is possible to get around this constraint. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the ability for slash commands to be used. This also leaves the possibility of using commands the old fashion way just by typing the commands. This implementation trys to make it the easiest to switch commands to work with the new system so they way commands are coded will be the same. This will also make it easy to switch commands in other pull requests (like #11 and #16 ). If you want to do some testing switch the line
src/main/kotlin/de/bigboot/ggtools/fang/Command.kt#164to.createGuildApplicationCommand(applicationId, 1234512345L, command.build())The number is the guild you want to do testing in, this is because when using global commands discord can take up to a hour to fully populate everything.
Here is also an example of what using the normal command is like compared to the slash command.
Here is what it would look like for the user when trying to pick what command they want to use.
Everything is in the same order as in
!commands. Don't worry about the top item being/list, this was just from testing as I don't know how to delete the commands. All the commands will have a description and the arguments required. The reason that only one command shows actual arguments is because that is the one I am hovered over but they will all show that.Everything should also work the same as in the normal commands, mainly the permissions and the error messages.