[commands] Default construct flags if they're not passed as parameters
This only applies if and only if the flag can be default constructible. Ergo, all the flags are optional or not required.
This commit is contained in:
@@ -559,6 +559,8 @@ class Command(_BaseCommand):
|
||||
if required:
|
||||
if self._is_typing_optional(param.annotation):
|
||||
return None
|
||||
if hasattr(converter, '__commands_is_flag__') and converter._can_be_constructible():
|
||||
return await converter._construct_default(ctx)
|
||||
raise MissingRequiredArgument(param)
|
||||
return param.default
|
||||
|
||||
|
Reference in New Issue
Block a user