aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli <[email protected]>2018-02-10 22:07:44 -0800
committerEli <[email protected]>2018-02-10 22:07:44 -0800
commitad7506050c9ea0515335da4b8e87b2a5d537cc3a (patch)
treecb097ec70e66a46453031d95a46e74eb775997e8
parentFixed opus error check (diff)
downloaddiscord.py-ad7506050c9ea0515335da4b8e87b2a5d537cc3a.tar.xz
discord.py-ad7506050c9ea0515335da4b8e87b2a5d537cc3a.zip
[commands] Allow builtin unbound method converters
-rw-r--r--discord/ext/commands/core.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py
index aba9ccf7..ef4b238c 100644
--- a/discord/ext/commands/core.py
+++ b/discord/ext/commands/core.py
@@ -201,8 +201,13 @@ class Command:
if converter is bool:
return _convert_to_bool(argument)
- if converter.__module__.startswith('discord.') and not converter.__module__.endswith('converter'):
- converter = getattr(converters, converter.__name__ + 'Converter')
+ try:
+ module = converter.__module__
+ except:
+ pass
+ else:
+ if module.startswith('discord.') and not module.endswith('converter'):
+ converter = getattr(converters, converter.__name__ + 'Converter')
if inspect.isclass(converter):
if issubclass(converter, converters.Converter):