Michael H
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
6 deletions
-
discord/ext/commands/core.py
|
|
@ -444,13 +444,16 @@ class Command(_BaseCommand): |
|
|
|
|
|
|
|
try: |
|
|
|
if inspect.isclass(converter): |
|
|
|
if issubclass(converter, converters.Converter): |
|
|
|
instance = converter() |
|
|
|
ret = await instance.convert(ctx, argument) |
|
|
|
return ret |
|
|
|
if inspect.ismethod(converter.convert): |
|
|
|
if converter.convert.__self__ is converter: |
|
|
|
# class method |
|
|
|
func = converter.convert |
|
|
|
else: |
|
|
|
# instance method |
|
|
|
func = converter().convert |
|
|
|
return await func.convert(ctx, argument) |
|
|
|
elif isinstance(converter, converters.Converter): |
|
|
|
ret = await converter.convert(ctx, argument) |
|
|
|
return ret |
|
|
|
return await converter.convert(ctx, argument) |
|
|
|
except CommandError: |
|
|
|
raise |
|
|
|
except Exception as exc: |
|
|
|