Skip to content

Commit

Permalink
[commands] Unwrap Parameter if given as default to commands.parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Soheab authored Oct 16, 2024
1 parent b0c66b7 commit c5e7406
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions discord/ext/commands/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ async def wave(ctx, to: discord.User = commands.parameter(default=lambda ctx: ct
.. 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,
Expand Down

0 comments on commit c5e7406

Please sign in to comment.