Kord-Extensions / kord-extensions

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

defaultingBoolean looking weird on the help command #83

Open Unicorn7141 opened 3 years ago

Unicorn7141 commented 3 years ago

Description

I was trying to make a shop command which allows people to add an item and decide whether it's limited to quantity X or not, using a defaultingBoolean with a default false. When I checked the command using help it showed the following: [limited?: yes/no=false] which could be quite confusing.

Versions

KordEx version: 1.5.0-SNAPSHOT

Reproduction

Code Examples

class Test : Arguments() {
    val bool by defaultingBoolean("bool", "The boolean to print", defaultValue = false)
}

Suggestions

Change the help command to show "yes" or "no" according to true or false

Media

Click to expans ![image](https://user-images.githubusercontent.com/49371158/133963181-f358b484-7fa5-47b6-bf3d-dfad81b9150b.jpg)
boring-cyborg[bot] commented 3 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

Having looked into this, defaulting converters will show the precise value you've provided as the default value there. I'm not sure special-casing Boolean converters for this is the way to go, maybe some kind of translation method? I'm really not sure - I'll have to think about it.

gdude2002 commented 2 years ago

So far, I haven't been able to come up with a smart solution for this.