Try to pull DM channels from cache on CHANNEL_CREATE

This commit is contained in:
RogueException
2017-08-17 02:53:34 -03:00
parent 6b5a6e7f1f
commit f997089174

View File

@@ -699,7 +699,12 @@ namespace Discord.WebSocket
}
}
else
{
channel = State.GetChannel(data.Id);
if (channel != null)
return; //Discord may send duplicate CHANNEL_CREATEs for DMs
channel = AddPrivateChannel(data, State) as SocketChannel;
}
if (channel != null)
await TimedInvokeAsync(_channelCreatedEvent, nameof(ChannelCreated), channel).ConfigureAwait(false);