Fix fetching invites on guilds the user is not in

This commit is contained in:
Rapptz 2020-01-25 03:29:14 -05:00
parent ba112e6ec8
commit 0033cc83ef

View File

@ -296,7 +296,7 @@ class Invite(Hashable):
channel_id = int(channel_data['id'])
channel_type = try_enum(ChannelType, channel_data['type'])
channel = PartialInviteChannel(id=channel_id, name=channel_data['name'], type=channel_type)
if guild is not None:
if guild is not None and not isinstance(guild, PartialInviteGuild):
# Upgrade the partial data if applicable
channel = guild.get_channel(channel_id) or channel