diff options
| author | Josh <[email protected]> | 2021-04-22 13:21:02 +1000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-21 23:21:02 -0400 |
| commit | 8457f70477386091ee04dbc0e47ec6575a13641a (patch) | |
| tree | c345ddbfffe8fec8a799ddc2b0cb6ec8f03ec814 /discord/ext/commands/flags.py | |
| parent | [docs] stage_channels doc typo (diff) | |
| download | discord.py-8457f70477386091ee04dbc0e47ec6575a13641a.tar.xz discord.py-8457f70477386091ee04dbc0e47ec6575a13641a.zip | |
[commands] Set constructible FlagConverter flags to not be required
Diffstat (limited to 'discord/ext/commands/flags.py')
| -rw-r--r-- | discord/ext/commands/flags.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/discord/ext/commands/flags.py b/discord/ext/commands/flags.py index b84e9a18..abffbbcd 100644 --- a/discord/ext/commands/flags.py +++ b/discord/ext/commands/flags.py @@ -184,6 +184,9 @@ def get_flags(namespace: Dict[str, Any], globals: Dict[str, Any], locals: Dict[s annotation = flag.annotation = resolve_annotation(flag.annotation, globals, locals, cache) + if flag.default is MISSING and issubclass(annotation, FlagConverter) and annotation._can_be_constructible(): + flag.default = annotation._construct_default + if flag.aliases is MISSING: flag.aliases = [] |