mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-08-11 14:02:13 +00:00
[commands] Fix converters not working with Optional for hybrids
This commit is contained in:
parent
6e7fc133d1
commit
1cd90f8b1c
@ -256,7 +256,7 @@ def replace_parameter(
|
||||
# Special case Optional[X] where X is a single type that can optionally be a converter
|
||||
inner = args[0]
|
||||
is_inner_transformer = is_transformer(inner)
|
||||
if is_converter(inner) and not is_inner_transformer:
|
||||
if (is_converter(inner) or inner in CONVERTER_MAPPING) and not is_inner_transformer:
|
||||
param = param.replace(annotation=Optional[ConverterTransformer(inner, original)])
|
||||
else:
|
||||
raise
|
||||
|
Loading…
x
Reference in New Issue
Block a user