aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-01-31 04:57:13 -0500
committerRapptz <[email protected]>2017-01-31 04:57:13 -0500
commitaac769eb56160620464a5a51f4ac22f92972abbd (patch)
treeccbf5782c560eb7965fd271ad0527cafa70d9a32
parentFix Member.permissions_in passing in the wrong self parameter. (diff)
downloaddiscord.py-aac769eb56160620464a5a51f4ac22f92972abbd.tar.xz
discord.py-aac769eb56160620464a5a51f4ac22f92972abbd.zip
[commands] Fix converters returning the wrong types when an ID is passed
-rw-r--r--discord/ext/commands/converter.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/ext/commands/converter.py b/discord/ext/commands/converter.py
index 90fee6da..a6f921fe 100644
--- a/discord/ext/commands/converter.py
+++ b/discord/ext/commands/converter.py
@@ -152,7 +152,7 @@ class TextChannelConverter(IDConverter):
else:
result = _get_from_guilds(bot, 'get_channel', channel_id)
- if result is None:
+ if not isinstance(result, discord.TextChannel):
raise BadArgument('Channel "{}" not found.'.format(self.argument))
return result
@@ -180,7 +180,7 @@ class VoiceChannelConverter(IDConverter):
else:
result = _get_from_guilds(bot, 'get_channel', channel_id)
- if result is None:
+ if not isinstance(result, discord.VoiceChannel):
raise BadArgument('Channel "{}" not found.'.format(self.argument))
return result