Add the ability to use slash commands #17
Closed
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.