[commands] Add support for typing.Annotated

This commit is contained in:
Rapptz
2022-04-22 06:21:10 -04:00
parent ab33551553
commit 5fcd4e411f
3 changed files with 35 additions and 0 deletions

View File

@@ -625,6 +625,9 @@ def get_supported_annotation(
if hasattr(annotation, '__discord_app_commands_transform__'):
return (annotation.metadata, MISSING)
if hasattr(annotation, '__metadata__'):
return get_supported_annotation(annotation.__metadata__[0])
if inspect.isclass(annotation):
if issubclass(annotation, Transformer):
return (annotation, MISSING)