Fix regression with unresolved channels due to reordering.

Channels are meant to fallback to Object if the message is out of
order. Somewhere along the commit line this got removed despite the
issue still existing.
This commit is contained in:
Rapptz 2019-06-29 19:41:03 -04:00
parent 68342db04d
commit 2c16e43e8a

View File

@ -47,6 +47,7 @@ from .role import Role
from .enums import ChannelType, try_enum, Status, Enum
from . import utils
from .embeds import Embed
from .object import Object
class ListenerType(Enum):
chunk = 0
@ -260,15 +261,16 @@ class ConnectionState:
yield self.receive_chunk(guild.id)
def _get_guild_channel(self, data):
channel_id = int(data['channel_id'])
try:
guild = self._get_guild(int(data['guild_id']))
except KeyError:
channel = self.get_channel(int(data['channel_id']))
channel = self.get_channel(channel_id)
guild = None
else:
channel = guild and guild.get_channel(int(data['channel_id']))
channel = guild and guild.get_channel(channel_id)
return channel, guild
return channel or Object(id=channel_id), guild
async def request_offline_members(self, guilds):
# get all the chunks