Closed russellbanks closed 5 months ago
Hello, and thanks for opening an issue! As this is the first time you've created an issue on this repository, we'd just like to offer you a warm welcome to the project, and the following pointers:
Please provide as much information as possible when asking a question, reporting a problem, or submitting a feature request. This will help us to address your issue quickly and efficiently. If you forgot to add some information, no worries - feel free to edit the issue and add anything you missed!
Thanks for contacting us! If you have any further questions, please feel free to join us on Discord in the #dev-kotdis
channel (or #kordex-discussion
for Kord Extensions projects), or to contact a staff member directly.
I think we could probably fix up converters a bit like this - I agree that supporting both in the same converter is likely to be the best option.
I'm not sure whether I'll get a chance to work on this soon, however, so I'd suggest making use of the latest snapshot (1.5.2-SNAPSHOT
) and using a regular enum converter with an autoComplete set up as a workaround temporarily.
This has just been pushed to 1.8.1-SNAPSHOT
, and should be available in about 15 minutes. Thanks for your patience!
Chat commands should now support choice converters. Users may specify either the keys or values (case-insensitively wherever strings are involved) and an error showing the possible values will be returned if nothing matches.
The new documentation site has been updated to match this change.
Summary
When using an enum choice converter on a chat command, it will result in an
java.lang.IllegalStateException: Choice converters may only be used with slash commands
error. In the use case of hybrid commands, it would beneficial to ensure that a hybrid command, utilising an enum choice, can work with a slash command whilst not failing as a chat command.Current Behaviour
Using an enum choice on a chat command results in a
java.lang.IllegalStateException: Choice converters may only be used with slash commands
error.Preferred Behaviour
An enum choice converter for a chat command should work the same as a normal enum choice converter.
Suggestions
#1 of Kordex hybrid commands documents this better.
Media
Using a command with a choice converter:
Using the equivalent chat command: