[commands] Allow Converter instances in Greedy. Fix #1939.
This commit is contained in:
parent
21a296d538
commit
69f5a70eeb
@ -500,8 +500,8 @@ class _Greedy:
|
|||||||
raise TypeError('Greedy[...] only takes a single argument')
|
raise TypeError('Greedy[...] only takes a single argument')
|
||||||
converter = params[0]
|
converter = params[0]
|
||||||
|
|
||||||
if not inspect.isclass(converter):
|
if not inspect.isclass(converter) and not isinstance(converter, Converter):
|
||||||
raise TypeError('Greedy[...] expects a type.')
|
raise TypeError('Greedy[...] expects a type or a Converter instance.')
|
||||||
|
|
||||||
if converter is str or converter is type(None) or converter is _Greedy:
|
if converter is str or converter is type(None) or converter is _Greedy:
|
||||||
raise TypeError('Greedy[%s] is invalid.' % converter.__name__)
|
raise TypeError('Greedy[%s] is invalid.' % converter.__name__)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user