diff options
| author | Rapptz <[email protected]> | 2017-06-17 21:16:10 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-06-17 21:16:10 -0400 |
| commit | 7d001ef46ee26f0d55faa8dd6718837ea1053e80 (patch) | |
| tree | d912abc5a675873056dda52d34e654562c6c972a | |
| parent | Properly quote reason header so non-ASCII works in audit log reasons. (diff) | |
| download | discord.py-7d001ef46ee26f0d55faa8dd6718837ea1053e80.tar.xz discord.py-7d001ef46ee26f0d55faa8dd6718837ea1053e80.zip | |
[commands] Try to use the proper name when conversion fails.
| -rw-r--r-- | discord/ext/commands/core.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 4c541f41..c00ed9dc 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -254,7 +254,12 @@ class Command: except CommandError as e: raise e except Exception as e: - raise BadArgument('Converting to "{0.__name__}" failed.'.format(converter)) from e + try: + name = converter.__name__ + except AttributeError: + name = converter.__class__.__name__ + + raise BadArgument('Converting to "{}" failed.'.format(name)) from e @property def clean_params(self): |