Browse Source

[commands] Set constructible FlagConverter flags to not be required

pull/6776/head
Josh 4 years ago
committed by GitHub
parent
commit
8457f70477
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      discord/ext/commands/flags.py

3
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 = []

Loading…
Cancel
Save