From 5afad9f7cc2fc75a3640ae77b3054e8f367cc50d Mon Sep 17 00:00:00 2001 From: Varun J Date: Sun, 1 May 2022 12:18:11 +0530 Subject: [PATCH] [commands] fix signature when displayed_default is missing This makes it so that passing an empty string (or MISSING) to the displayed_default of commands.Parameter not show up as [name=] or [name=...] --- discord/ext/commands/core.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 55f63fd1d..e5b1f0256 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -1104,8 +1104,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): if not param.required: # We don't want None or '' to trigger the [name=value] case and instead it should # do [name] since [name=None] or [name=] are not exactly useful for the user. - should_print = param.default if isinstance(param.default, str) else param.default is not None - if should_print: + if param.displayed_default: result.append( f'[{name}={param.displayed_default}]' if not greedy else f'[{name}={param.displayed_default}]...' )