Add the ability to set the option name with commands.Option

This commit is contained in:
StockerMC
2021-10-15 13:32:55 -04:00
parent e0bf2f9121
commit 8f846ba2f5
2 changed files with 9 additions and 3 deletions

View File

@@ -174,8 +174,12 @@ def get_signature_parameters(
annotation = parameter.annotation
if isinstance(parameter.default, Option): # type: ignore
option = parameter.default
descriptions[name] = option.description
parameter = parameter.replace(default=option.default)
if option.name is not MISSING:
name = option.name
parameter.replace(name=name)
descriptions[name] = option.description
if annotation is parameter.empty:
params[name] = parameter