[commands] Unwrap Parameter if given as default to commands.parameter

This commit is contained in:
Soheab 2024-10-17 00:48:49 +02:00 committed by GitHub
parent b0c66b7734
commit c5e74068f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -247,6 +247,12 @@ def parameter(
.. versionadded:: 2.3
"""
if isinstance(default, Parameter):
if displayed_default is empty:
displayed_default = default._displayed_default
default = default._default
return Parameter(
name='empty',
kind=inspect.Parameter.POSITIONAL_OR_KEYWORD,