[commands] Fix flag detection code in get_flags

This commit is contained in:
Rapptz 2021-04-22 07:54:37 -04:00
parent e09f64b7c9
commit 8e9860077d

View File

@ -184,7 +184,7 @@ 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():
if flag.default is MISSING and hasattr(annotation, '__commands_is_flag__') and annotation._can_be_constructible():
flag.default = annotation._construct_default
if flag.aliases is MISSING: