Kord-Extensions / kord-extensions

Kord extensions framework, providing commands and distinct units of functionality
https://kordex.dev
European Union Public License 1.2
112 stars 27 forks source link

Add minValue and maxValue to int/decimal argument converters #156

Closed Galarzaa90 closed 2 years ago

Galarzaa90 commented 2 years ago

Summary

Add minValue and maxValue options to tIntConverterBuilder and DecimalConverterBuilder and derivatives.

They are defined here in the documentation: https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure

And they were added to Kord since: https://github.com/kordlib/kord/commit/4a73bfa2146df3980a4cf6c0d5fd613f31b29bbb

Current Behaviour

It is not possible to use these options, so these validations must be done after receiving the interaction with the validate option. While this allows more customization in error messages, it means receiving a command interaction that will be "rejected" by the bot.

Preferred Behaviour

Being able to use this option would mean that these options will be validated on the client's side, meaning you wouldn't receive the command interaction message if the numbers are invalid.

boring-cyborg[bot] commented 2 years 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:

gdude2002 commented 2 years ago

This has been added, but could do with some gentle poking - please verify.

Galarzaa90 commented 2 years ago

Everything seems to be working fine 👍🏼

gdude2002 commented 2 years ago

Thanks for the confirmation o7