Browse Source

[commands] Allow converters from custom discord.ext extensions

Originally the converting of an argument with type in the discord.*
package would try to use the predefined converters, even if there were
none present. This is fixed by supplying a default argument to getattr

Fixes #2369
pull/2382/head
romangraef 6 years ago
committed by Rapptz
parent
commit
bc642ded6e
  1. 2
      discord/ext/commands/core.py

2
discord/ext/commands/core.py

@ -347,7 +347,7 @@ class Command(_BaseCommand):
pass
else:
if module is not None and (module.startswith('discord.') and not module.endswith('converter')):
converter = getattr(converters, converter.__name__ + 'Converter')
converter = getattr(converters, converter.__name__ + 'Converter', converter)
try:
if inspect.isclass(converter):

Loading…
Cancel
Save