mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-21 00:07:51 +00:00
[commands] Fix converters returning the wrong types when an ID is passed
This commit is contained in:
parent
a632bdd871
commit
aac769eb56
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user